function a(n,s) { s=1/s; return (n*s).toFixed(0)/s } function b(n,s) { s=1/s; return Math.floor(n*s).toFixed(0)/s } alert(a(4.648,0.01)+" "+b(4.648,0.01));