Format number with javascript

0

I have the following value: 7500 How do I get this value as final result: 75.00 , I would like to use pure javascript only.

Other examples:

76000 > 760.00
1600 > 16.00

I tried to use toFixed but it did not work

var number = 76900
var value = parseFloat(Math.round(number * 100) / 100).toFixed(2)
console.log(value)//Esperava 769.00 como resultado
    
asked by anonymous 05.07.2018 / 00:39

1 answer

0

Solved, I used parseFloat(Math.round(number / 100)).toFixed(2)

    
05.07.2018 / 00:49