Rounding up numbers using @Formula?

Hello there fellow developers.

I’ve been trying to get decimal numbers to round up using Formula languages, but nothing seems to work. I’ve used both @Round and @Integer, but it keeps rounding to the nearest integer rather than automatically rounding it up.

Given two examples, 808.9 and 808.3, I need to get it both rounded up to 809. Using @Intefer and @Round rounds both respectively to 809 and 808. How do I make it that both are rounded up instead of rounding down? And how do I make it so that if the number is not a decimal number, it shouldn’t round at all?

I know there’s a way to do it in the Lotusscript, but I need to find a way in Formula language. Anyone knows how to do this?

Subject: Rounding up numbers using @Formula?

Hi try @round(number + 0.5)

Subject: RE: Rounding up numbers using @Formula?

I can’t believe I didn’t think of that earlier. Haha.

But nevertheless, thank you so much for the help :slight_smile:

By any chance do you know how to make it detect whether it’s a decimal or not? So that it won’t need to round up if it’s not a decimal, if possible.

Subject: RE: Rounding up numbers using @Formula?

Hi Farah,I Suppose you are trying to detect if its a whole number or not. If thats the case one simple way you could follow is

tmp := @Subset(@Explode@Text((@Round(0.5 + Number));“.”);-1);

@if(@ToNumber(tmp)=0;“Has No Decimal Part”;“Has Decimal”);

Hope That Helps

Sudip

Subject: RE: Rounding up numbers using @Formula?

Hi Sudip.

Thank you so much for the help!

I never thought to use @Explode and @Subset before, since I’m very new to Formula languages. But anyway, thanks again :slight_smile:

Subject: RE: Rounding up numbers using @Formula?

No problem :-), it happened to everyone