DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR JAVASCRIPT
javascript convert number to string with 2 decimal places
(Math.round(num * 100)/100).toFixed(2); // 1.346 -> 1.35
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#javascript
#convert
#number
#string
#decimal
#places
ADD COMMENT
Topic
COMMENT
Name
5+9 =
Submit