KevinSheedy / jquery.alphanum

Alphanumeric Plugin for jQuery
Other
141 stars 66 forks source link

Max value still accepts decimals #27

Open EmilHelldin opened 10 years ago

EmilHelldin commented 10 years ago
$.fn.alphanum.setNumericSeparators({
    thousandsSeparator: " ",
    decimalSeparator: ","
});

$(".numericWeight").numeric({ allowMinus: false, allowThouSep: false, max: 2000, maxDecimalPlaces: 3 });

2000,999 is a valid input which it shouldn't.

kaushikshan commented 9 years ago

In the jquery.alphanum.js fucntion isGreaterThanMax,

Replace var outputNumber = parseFloat(numericString); with var outputNumber = accounting.unformat(numericString, DEC_SEP);

This should solve your problem!