So , i have a problem . i am calculating the discount and it may be in decimal points . the method i am using is not working for the value 0.0038575 and the method is
value=0.0038575
Math.round(value * 100) / 100,
it is returning the same value . this method is working for all other values . but the expected result is 0.004
now i changed the method i used this one var discount = 0.0038575.toFixed(3); working fine but the issue with this is it is not working if i pass the variable like below
var value=0.0038575;
var discount = value.toFixed(3);
error is value.toFixed is not a functioni also tried this one for solve
var value=0.0038575;
var discount = "'"+value+"'".toFixed(3);
any help will be appreciated . thanx in advance