I have a response which is sending me a value of 0.0554
And the following is my code to convert it into a percentage and display it.
var m_e = JSON.parse(JSON.stringify(data)).moe;
console.log(m_e); //here I am getting 0.0554
var e = m_e*100;
console.log(e); //here I am getting 5.539999999999999
$('#element').html('±' + e + '%');
And as a result I am getting this enormous value. But I want to print 5.54 only.
Where am I going wrong?
Any kind of help will be greatly appreciated. Thanks.