cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Report Rounding Third Digit 0.005

former_member1173617
Participant
0 Kudos

Why does crystal round properly

I am doing a simple calculation

1 x £1.425 and it is giving me £1.42 when i need £1.43??

Please can anyone help?

Thanks

Mike

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member1173617
Participant
0 Kudos

Hi Riraj,

Where did you go to type in your formula will try the same my end.

Thanks

Former Member
0 Kudos

Create a new formula on your Crystal report available on the right hand side of Crystal Report Editor under Formula Fields and just select the field which you want to be rounded in pace of {Table.NumberField} in below code. Then just drag that formula to the report


Round({Table.NumberField},2)

Regards

Niraj

former_member1173617
Participant
0 Kudos

Hi Niraj, 

Sorry but what I would like is this rule

Greater or = 0.005 then round up

Less than 0.005 then round down.

So 1 x £1.425 should be £1.43

and 1x£1.424 should be £1.42

Thanks

Former Member
0 Kudos

Hello Mike,

That works exactly the same way as you are expecting in my machine.Please find attached screen shot.


Regards

Niraj

former_member226669
Participant
0 Kudos

Hi Mike,

Add the below code to the formula:

Truncate({field},2)

Thanks,

Nrupal

former_member1173617
Participant
0 Kudos

Hi Niray,

Many thanks for your quick reply.  I have change the Number Formatting but is still seems to be rounding down when i would expect it to round up? Do my setting look correct?

Former Member
0 Kudos

Hello Mike,

Ok then please disregard the previous approach just use the below code to round it up.

Round({Table.NumberField},2)

Regards

Niraj

Former Member
0 Kudos

Hello Mike,

Please right click on that number field and set the number format to three place decimal.

By default its 2 places decimal.

Regards

Niraj