|
|
@@ -219,11 +219,13 @@
|
|
|
isFinite(processValue);
|
|
|
},
|
|
|
onBeforeMask: function(initialValue, opts) {
|
|
|
- if (isFinite(initialValue)) return initialValue.toString().replace(".", opts.radixPoint);
|
|
|
- var kommaMatches = initialValue.match(/,/g), dotMatches = initialValue.match(/\./g);
|
|
|
- return dotMatches && kommaMatches ? dotMatches.length > kommaMatches.length ? (initialValue = initialValue.replace(/\./g, ""),
|
|
|
- initialValue = initialValue.replace(",", opts.radixPoint)) : kommaMatches.length > dotMatches.length && (initialValue = initialValue.replace(/,/g, ""),
|
|
|
- initialValue = initialValue.replace(".", opts.radixPoint)) : initialValue = initialValue.replace(new RegExp($.inputmask.escapeRegex.call(this, opts.groupSeparator), "g"), ""),
|
|
|
+ if ("" != opts.radixPoint && isFinite(initialValue)) initialValue = initialValue.toString().replace(".", opts.radixPoint); else {
|
|
|
+ var kommaMatches = initialValue.match(/,/g), dotMatches = initialValue.match(/\./g);
|
|
|
+ dotMatches && kommaMatches ? dotMatches.length > kommaMatches.length ? (initialValue = initialValue.replace(/\./g, ""),
|
|
|
+ initialValue = initialValue.replace(",", opts.radixPoint)) : kommaMatches.length > dotMatches.length ? (initialValue = initialValue.replace(/,/g, ""),
|
|
|
+ initialValue = initialValue.replace(".", opts.radixPoint)) : initialValue = initialValue.indexOf(".") < initialValue.indexOf(",") ? initialValue.replace(/\./g, "") : initialValue = initialValue.replace(/,/g, "") : initialValue = initialValue.replace(new RegExp($.inputmask.escapeRegex.call(this, opts.groupSeparator), "g"), "");
|
|
|
+ }
|
|
|
+ return 0 == opts.digits && (-1 != initialValue.indexOf(".") ? initialValue = initialValue.substring(0, initialValue.indexOf(".")) : -1 != initialValue.indexOf(",") && (initialValue = initialValue.substring(0, initialValue.indexOf(",")))),
|
|
|
initialValue;
|
|
|
}
|
|
|
},
|