FIX: Remove leading zero when doing local currency

This commit is contained in:
marcosrdz 2021-04-25 19:39:14 -04:00
parent bd64b3fe48
commit f3a31a256f

View File

@ -153,6 +153,9 @@ class AmountInput extends Component {
}
text = rez;
}
if (text.startsWith('0') && !(text.includes('.') || text.includes(','))) {
text = text.replace(/^(0+)/g, '');
}
text = text.replace(/[^\d.,-]/g, ''); // remove all but numbers, dots & commas
text = text.replace(/(\..*)\./g, '$1');
}