Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How do I round to 2 decimal places in JavaScript?

Use the toFixed() method to round a number to 2 decimal places, e.g. const result = num. toFixed(2) . The toFixed method will round and format the number to 2 decimal places.
Source by learnersbucket.com #
 
PREVIOUS NEXT
Tagged: #How #I #decimal #places
ADD COMMENT
Topic
Name
1+6 =