Answers for "how to add .0 in number in javascript"

2

add leading zeros to number javascript

const number = 5;
console.log(number.toString().padStart(2, '0')); // expected output: "05"
Posted by: Guest on August-12-2021
1

add leading zeros javascript

const str1 = '5';
console.log(str1.padStart(2, '0')); // expected output: "05"
Posted by: Guest on August-12-2021

Code answers related to "how to add .0 in number in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language