I\'ve got a currency input and need to return only significant digits. The input always has two decimal places, so:
4.00 -> 4
4.10 -> 4.1
4.01 ->
I am trying to find a solution like that right now. This is how I got here.
I used Number() function for my application, but looks like it's working the same as parseFloat()
http://jsfiddle.net/4WN5y/
I remove and commas before checking the number.
var valueAsNumber = Number( val.replace(/\,/g,'') );