Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

Round numers is javascript

I have a variable

varTest = 1.129

I want to round it to two decimal places so in this example it should be

1.13

How?
0
vbnetcoder
Asked:
vbnetcoder
1 Solution
 
nate0187Commented:
(10.8).toFixed(2); // 10.80

var num = 2.4;
alert(num.toFixed(2)); // 2.40
0
 
vbnetcoderAuthor Commented:
ty
0
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.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now