Skip to content
Advertisement

Javascript display the last 3 numbers after the dot fixed(3) not working

I have a number which looks number this:

JavaScript

This number changes all the time.

So I’m doing this:

JavaScript

This is displaying 800.600 … I need it to display the last 3 like:

JavaScript

How can I do this?

Advertisement

Answer

You can convert to string and do your manipulations. Please note we are loosing the right most digit due to limits of javascript.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement