Skip to content

Commit 83199e9

Browse files
committed
Rename a function
1 parent 8521365 commit 83199e9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/utils.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ function getCurrencyDividerAndDecimal(divider: CurrencyDivider | undefined) {
5757
};
5858
}
5959

60-
/** removes decimal dot and comma from a string */
61-
function removeDividerAndDecimal(value: string): string {
60+
function removeAllDotsAndCommas(value: string): string {
6261
return value.replace(/[,.]/g, '');
6362
}
6463

@@ -98,7 +97,7 @@ export function getValueFromCurrencyMask({
9897
if (value.length >= newValue.length) return undefined;
9998

10099
if (newValue.includes(decimal)) {
101-
let intVal = removeDividerAndDecimal(newValue.split(decimal)[0]);
100+
let intVal = removeAllDotsAndCommas(newValue.split(decimal)[0]);
102101
let fractionalVal = newValue.split(decimal)[1];
103102

104103
intVal = iDontYetKnowWhatsGoingOnHere(intVal, divider);
@@ -121,7 +120,7 @@ export function getValueFromCurrencyMask({
121120
}
122121
} else if (newValue.length > 3) {
123122
let arr: string[] = [];
124-
let unmasked = removeDividerAndDecimal(newValue);
123+
let unmasked = removeAllDotsAndCommas(newValue);
125124

126125
newValue = iDontYetKnowWhatsGoingOnHere(unmasked, divider);
127126
}

0 commit comments

Comments
 (0)