Skip to main content
jasonw51098449
Participant
Jul 20, 2019 5:30 AM UTC
Question

How to round numbers to hundreds

I'm using following javascript to make the calculation result round to hundreds. If calculation result is 19999,then a = 19900

a=Math.floor(b*0.0003/100)*100

Am I doing right?

This topic is closed to new replies. Start a new post to keep the conversation going.

3 replies

jasonw51098449
Participant
Jul 20, 2019 9:21 AM UTC

I tried it and seems working fine. But I'm new to javascript, kind of not sure if I'm doing right.

Translate
try67
Community Expert
Community Expert
Jul 20, 2019 4:58 PM UTC

If it works then what's the problem?

Translate
Bernd Alheit
Community Expert
Community Expert
Jul 20, 2019 6:36 AM UTC

Did you try it?

Translate