Skip to main content
Inspiring
November 17, 2021
Answered

round to nearest quarter

  • November 17, 2021
  • 2 replies
  • 459 views

Hi,

How do I round this numbers?

10.24 = 10

10.26 = 10.5

10.74 = 10.5

10.76 = 11

in Excel the function is MROUND or CEILING

This topic has been closed for replies.
Correct answer Mylenium

Simple math: You divide you value by the quantifier, round it and multiply it by the quantifier. In Javascript:

 

Math.round(value/0.5)*0.5

 

Mylenium

2 replies

CarlosCanto
Community Expert
Community Expert
November 17, 2021

check this thread on the "Related conversations", there's a function to round to the nearest quarter, it can be easily edited to round to nearest half

 

https://community.adobe.com/t5/acrobat-sdk-discussions/how-to-hide-trailing-zeros-in-a-number-rounding-to-nearest-quarter-hour/td-p/10321122

Mylenium
MyleniumCorrect answer
Legend
November 17, 2021

Simple math: You divide you value by the quantifier, round it and multiply it by the quantifier. In Javascript:

 

Math.round(value/0.5)*0.5

 

Mylenium