globalize
globalize copied to clipboard
Validation accepts both '.' and ',' as decimal separator for "sr-Latn" culture
I had a problem with validation, where both entries, 1.25 and 1,25 were accepted as regular decimal numbers for "sr-Latn" culture. Problem was that 1.25 was converted to 125 instead of returning invalid number.
After few days of exploring a problem, i finally found it in a "Handle Groups" part of ParseFloat function. integer = integer.split( groupSep ).join( "" ); line should be replaced with integer = integer.split(groupSep).join(nf["."]);
Can someone else confirm this behavior?
Thanks for reporting. But, Globalize 0.x isn't supported anymore. We're working on Globalize 1.x See README for more information.