Format number with decimal point as a separator - Javascript Number Operation

Javascript examples for Number Operation:Number Format

Description

Format number with decimal point as a separator

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width"> 
   </head> 
   <body> 
      <script>
var num=(999999999999999).toString().split("").reverse();
[3,6,7,10,13].forEach((i,o)=>num.splice(o+i,0,"."));
num=num.reverse().join("");
console.log(num);

      </script>  
   </body>/* w ww  . j  ava2s .  c o m*/
</html>

Related Tutorials