Round off in Appsheet

Hi,

I wanted to understand how rounding off works in appsheet as I am facing a roadblock where if my value computed is lesser than .5 then I want it to be rounded off to nearest 5 and if it’s greater than .5 then I want it to be rounded off to nearest 0.

For eg: 4.2 to be rounded to 4.5 and 4.7 rounded to 5.

Is there a way this can be achieved?

ROUND() only works with rounding up or down to the nearest integer.

I was thinking about this question for a while, but I never came up with anything fancy. I think the best thing you can do here is manually check whether the decimal is below 0.5 or higher. Something like:

IF(
  [number] - FLOOR( [number] ) <= 0.5 ,
  FLOOR( [number] ) + 0.5 ,
  CEILING( [number] )
)
3 Likes

Or possibly

CEILING([Your Number]/0.5)*0.5

Since you are looking for rouding up to only higher 0.5 based on your shared example.

5 Likes

I think this is exactly the “fancy” solution I was looking for! Man, I knew it was out there, just couldn’t quite grasp it…

2 Likes

Thank you for the help.

2 Likes

Thank you for the help

1 Like