Skip to content

Commit

Permalink
Use charIsNumber util in patternFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yadav committed Oct 25, 2022
1 parent ef700c2 commit 3f3c7f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/pattern_format.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
NumberFormatBaseProps,
} from './types';
import {
charIsNumber,
getCaretPosInBoundary,
getDefaultChangeMeta,
getMaskAtIndex,
Expand Down Expand Up @@ -49,7 +50,7 @@ export function removeFormatting<BaseType = InputAttributes>(
const removeFormatChar = (string: string, startIndex: number) => {
let str = '';
for (let i = 0; i < string.length; i++) {
if (isNumericSlot(startIndex + i) && string[i].match(/\d/)) {
if (isNumericSlot(startIndex + i) && charIsNumber(string[i])) {
str += string[i];
}
}
Expand Down

0 comments on commit 3f3c7f3

Please sign in to comment.