skij
asked on
JavaScript: String into number / 0 instead of NaN
I want to convert any string into a number with two decimals. This does not work for strings that contain letters:
alert( parseFloat(555).toFixed(2) );
alert( parseFloat('123').toFixed(2) );
alert( parseFloat('xyz').toFixed(2) );
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window