close #600 Fixed: Erratic behavior of payment amount

This commit is contained in:
cuneytsenturk 2018-12-25 11:56:10 +03:00
parent adcc68991f
commit 80c5803da8

View File

@ -616,12 +616,19 @@
function maskValueStandard(value, settings) {
var negative = (value.indexOf("-") > -1 && settings.allowNegative) ? "-" : "",
onlyNumbers = value.replace(/[^0-9]/g, ""),
valueWithoutSymbol = value.replace(settings.prefix, "").replace(settings.suffix, ""),
input_precision = value.length - value.lastIndexOf(settings.decimal) - 1,
integerPart = onlyNumbers.slice(0, onlyNumbers.length - input_precision),
newValue,
decimalPart,
leadingZeros;
if (settings.suffix != '' && value.length != valueWithoutSymbol.length) {
input_precision = valueWithoutSymbol.length - valueWithoutSymbol.lastIndexOf(settings.decimal) - 1;
integerPart = onlyNumbers.slice(0, onlyNumbers.length - input_precision);
}
newValue = buildIntegerPart(integerPart, negative, settings);
if (settings.precision > 0) {