Round Function not working properly in crystal reports - crystal-reports

Round() is not working properly in crystal reports. I have value 99.52865, I'm rounding the value to 4 decimal places by using Round function. The Function Displaying Value after rounding is 99.5286 but it has to round to 99.5287. For Some values it is rounding properly like 0.40465 to 0.4047. Facing issue for some values only.

Related

How to round field in SAP Crystal Report 2011?

Rounding of static value is different from rounding DB field value in SAP B1 crystal report 2011
I have 609,437.50 from Database when I go to Field Format and then round field I get 609,437
I have 609,437.50 in formula as static value when I round I get 609,438 which is correct same as excel
How can I round Database field and get value like 609,438 while I have 609,437.50?
Please anyone can help me
You likely have database value different from xxx.50.
What data type is your value in database - some float or decimal or money?
If float, then you have to convert it to decimal first - float values are inexact and rounding may behave strangely.
If decimal or money, then you may have more decimal places filled (like xxx.499), which rounds down again. You need either accept your results or round to two decimals first; this can be visually better, but is wrong mathematically.

Formatting a numeric field to fixed length in crystal reports

I have a crystal report where a numeric field needs to be a fixed length with a decimal and needs to not round up or down. I changed it to a text field but now when I run the report and I forget to change the options in crystal for a number field to show ####.## it rounds to nearest dollar amount and drops the cents. How can I fix it so I won't have to remember to change the options?
An example may be helpful -
If the field is numeric, or decimal, you can right click the field, select "format field", click Customize, Number, and select the rounding and decimal logic.
if you don't have enough decimal places allowed (say, zero decimals) then make sure the rounding is not set to "1" - that would cause the number to round up. if the rounding is less than or equal to the decimal places, it should just 'truncate' and not round.

Rounding for Decimal in crystal report

I am currently trying to round up the figure in my crystal report but the round function in crystal report does not change it to correct figure.
Currently i am using crystal report 10.0.0.533
I am trying to convert 1192.04 to 1192.05 and 1192.07 to 1192.05.
Is this the default formula in crystal report or is there anyway i can change the formula?
Regards,
Ck
You cannot round 1192.04 to 1192.05. If you round it, the result will be 1192. 1192.07 will be rounded to 1192.1. Rounding is removing one or more signs after the decimal. In the new versions of Crystal you can create a function to handle this in the way you are describing it. However the only option in version 10 will be to create a UFL and add a function there.

cdbl in crystal reports is giving wrong results in decimal points

Friends,
This is the formula in the crystal reports 9.
cdbl({nrconsolidated.collamt})/100000.000
nrconsolidated table is having 9 records.
in that one record's collamt value is 154250.
but in the crystal reports output its showing as 1.543 instead of 1.542.
i want only 3 decimal points.i dont know where the mistake is coming from?
in the crystal reports, i clicked on that collamt field and checked the data by seeing the browseData option...its showing as 154250.
how can i solve this issue? its showing the correct value in 4 decimal points but i want only 3 decimal points.
thanks
The below code will truncate the result after the calculation has been performed, and output it to 3 decimal places. This works for Crystal Syntax and should for Basic as well - I believe it is common amongst both.
truncate(cdbl({nrconsolidated.collamt})/100000.000,3)
On the field set the decimals 1.000 and rounding 0.001 will display what you want.

Display CR values as scientific notation

I have a series of very small positive and negative values stored in oracle which I am attempting to display in crystal reports. Crystal is displaying all the values as 0. However if I turn the max decimal places on I will see some values as 0.00...00XY.
I would like these values simply displayed as scientific notation with something like 1.2E-12.
It seems crystal automatically converts very large values to SN, but not very small values?
This is not possible so I went and created a view instead for each needed table. Kind of a dumb solution, but it seems the only way possible.