Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to limit decimal places in javascript

let pi = 3.141;
let rounded = pi.toFixed(1);
console.log(rounded); //output: 3.1
 
PREVIOUS NEXT
Tagged: #limit #decimal #places #javascript
ADD COMMENT
Topic
Name
4+3 =