use for-of statements to replace for and for-in
This commit is contained in:
@@ -338,18 +338,20 @@ watch(currentValue, (newValue) => {
|
||||
const decimalSeparator = getCurrentDecimalSeparator();
|
||||
|
||||
if (newValue[0] === '-' || newValue[0] === decimalSeparator) {
|
||||
actualNumeralSystem = NumeralSystem.detect(newValue[1]);
|
||||
actualNumeralSystem = NumeralSystem.detect(newValue.charAt(1));
|
||||
} else {
|
||||
actualNumeralSystem = NumeralSystem.detect(newValue[0]);
|
||||
actualNumeralSystem = NumeralSystem.detect(newValue.charAt(0));
|
||||
}
|
||||
|
||||
if (actualNumeralSystem && (actualNumeralSystem.type === NumeralSystem.WesternArabicNumerals.type || actualNumeralSystem.type === numeralSystem.value.type)) {
|
||||
for (let i = 0; i < newValue.length; i++) {
|
||||
if (!NumeralSystem.WesternArabicNumerals.isDigit(newValue[i]) && !numeralSystem.value.isDigit(newValue[i]) && newValue[i] !== '-' && newValue[i] !== decimalSeparator) {
|
||||
const ch = newValue.charAt(i);
|
||||
|
||||
if (!NumeralSystem.WesternArabicNumerals.isDigit(ch) && !numeralSystem.value.isDigit(ch) && ch !== '-' && ch !== decimalSeparator) {
|
||||
break;
|
||||
}
|
||||
|
||||
finalValue += newValue[i];
|
||||
finalValue += ch;
|
||||
}
|
||||
|
||||
finalValue = numeralSystem.value.replaceWesternArabicDigitsToLocalizedDigits(finalValue);
|
||||
|
||||
Reference in New Issue
Block a user