5 Replies Latest reply: Jul 10, 2014 6:31 PM by Yeo Poh sai

# How to round the last 2 decimal either 0.50 or 0.00 ?

Hi All

I need to make :-

71.15 to 71.50

83.34 to 83.5

95.54 to 95

Below is my expression :-

Ceil(

If( column(1)>10,Round( column(1)), column(1))

,0.5)

it does not work. hope some expert here can help me pls.

Paul

• ###### Re: How to round the last 2 decimal either 0.50 or 0.00 ?

You are not applying the same logic to all your values,

the first two are rouded to the upper 0.5, the third to the lower;

which is the logic?

• ###### Re: Re: How to round the last 2 decimal either 0.50 or 0.00 ?

if ( column(1) < 80 ,

num(  ceil ( column(1),0.5) , '#.##') ,

if ( column(1) < 90 ,

num( Ceil( column(1),0.5) , '#.#')  ,

num( Ceil(  column(1),0.5) , '#0') ) )

But, as Alessandro says, your question is not clear, so I am not confident it is what you want.

• ###### Re: How to round the last 2 decimal either 0.50 or 0.00 ?

Hi Bill

Thank you very much. Your script is very easy for me modify to what i want.

if ( column(1) <10 ,

num( ( column(1)) , '#.##')  ,

num( Ceil(  column(1),0.5) , '#.#') )

Yes my question is confuse , but logically i want to round up 95.54 i want to round 96.00 and for small value less then 10 i don't want to round .

Paul

• ###### Re: How to round the last 2 decimal either 0.50 or 0.00 ?

Hi Paul,

I guess this is the right expression:

If(column(1)>10, Round(column(1), 1, 0.5), column(1))

- Ralf

• ###### Re: How to round the last 2 decimal either 0.50 or 0.00 ?

No, now I got it:

If(frac(column(1))*10>5, floor(column(1)), Round(column(1), 1, 0.5))

This will round your examples right..