Round to the nearest 0.5

Stimulsoft Reports.NET discussion
Post Reply
rafael.custodio
Posts: 31
Joined: Thu May 30, 2019 1:01 pm

Round to the nearest 0.5

Post by rafael.custodio »

Hi guys, I need some help to round some values in a report following some rules.

Example:

From 7.1 till 7.4 it should be rounded to 7.5
From 7.6 till 7.9 it should be rounded to 8.0

I know that the Round function follows the international math rounding rules. Is there a way to do this ?
I appreciate any ideas or help with this question.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Round to the nearest 0.5

Post by HighAley »

Hello.

Please, try to use this expression:

Code: Select all

{Ceiling(Var*2)/2}
Thank you.
rafael.custodio
Posts: 31
Joined: Thu May 30, 2019 1:01 pm

Re: Round to the nearest 0.5

Post by rafael.custodio »

@HighAley, it worked. Thanks a lot !!
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Round to the nearest 0.5

Post by HighAley »

Hello.

We are always glad to help you.
Let us know if you need any additional help.

Thank you.
Post Reply