Answers for "get number with 1 decimals javascript"

14

js number 2 decimal places

(3.141596).toFixed(2);	// 3.14
Posted by: Guest on August-13-2020
0

get the integer after decimal in javascript

const number = 2.3;
const numberAfterDecimal = parseInt((number % 1).toFixed(2).substring(2));
const numberBeforeDecimal = parseInt(number);

console.log("value before decimal", numberBeforeDecimal);
console.log("value after decimal", numberAfterDecimal);
Posted by: Guest on May-25-2021

Code answers related to "get number with 1 decimals javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language