Jump to content

Setting precison


Recommended Posts

use toFixed(), in your case varable.toFixed(2);see below:

<script>var profits=2489;alert("before toFixed(): "+profits);profits=profits.toFixed(2);alert("after toFixed(): "+profits);</script>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...