Skip to main content
jasonw51098449
Participant
July 20, 2019
Question

How to round numbers to hundreds

  • July 20, 2019
  • 2 replies
  • 332 views

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 has been closed for replies.

2 replies

jasonw51098449
Participant
July 20, 2019

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

try67
Community Expert
Community Expert
July 20, 2019

If it works then what's the problem?

Bernd Alheit
Community Expert
Community Expert
July 20, 2019

Did you try it?