I'm looking at an old version but seems current code has the same issue.
parseFloat('01111') === 1111
"01111" is not a number, but is instead a string.
|
function numberType(item) { |
|
var rtn = parseFloat(item); |
|
if (isNaN(rtn)) { |
|
return item; |
|
} |
|
return rtn; |
|
} |
Unfortunately isFinite('01111') === true also otherwise it may be a solution.
You may need a Regex based approach.