Stop rounding numbers

I have the below and am horrible with JS - the number seem to be rounding - but want to leave it as is - more of a "mask" - but just want 3 places out past the decimal, but no rounding.

(parseFloat(value) * 1.0).toFixed(3)
Who is Participating?

Improve company productivity with a Business Account.Sign Up

ChristoferDutzConnect With a Mentor Commented:
How about "toString" and then cutting off the last digits?

var stringValue = String(8756.324932);
var pos = stringValue.indexOf(".");
var maskedValue = stringValue(0, pos + 4);

Open in new window

fsze88Connect With a Mentor Commented:
like this?
<script language="javascript">
var threedigit = new String( (parseFloat(123.456789)).toFixed(4) );
document.write( threedigit.substr(0,threedigit.length-1) );

Open in new window

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.