I have:
var a = 0.0532;
var b = a * 100;
b should be returning 5.32 but instead it's returning 5.319999999999999. How do I fix this?
JSFiddle here: http://jsfiddle.net/9f2K8/
you should use .toFixed()
var a = 0.0532;
var b = a * 100;
b.toFixed(2); //specify number of decimals to be displayed