Link to home
Start Free TrialLog in
Avatar of DeeL9
DeeL9

asked on

Show decimal places in Crystal Reports

I'm using Crystal Reports 8.5
I have a number field that can have a varying # of decimal places.
For example the field could be:

1.234567
1.2345
123.4567

The maximum a # could be is: 999.999999 it can never be 1000.

In reality the # of decimal places can vary to be any #...

I want to show 6 decimal places.
If there are not 6 decimal places I want to show only 4.
I could make the data in the database have only 6 or 4 decimal places if that could help in a solution.

I have a formula that I thought would do it, but unfortunately I can't format the maximum #, the formula becomes invalid for that 6th decimal point, it only works till 5 decimal points, and I'm not quite sure why...
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Hello DeeL9,

How is the field defined in the database?

Pete
Avatar of DeeL9
DeeL9

ASKER

It is stored as a NUMBER in an Oracle Database.
Have you used the Crystal format then set the number of places using a formula?

What is wrong with your method?

mlmcc
ASKER CERTIFIED SOLUTION
Avatar of bdreed35
bdreed35
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DeeL9

ASKER

Describe what you mean?
Format it to what and use what formula?

Essentially if the # in the database is 123.4567 i want it to display 123.4567
If the # is 123.456789, I want to show 123.456789.
If the # is 1.2 I want it to show as 1.2.
If the # is 1.234001 I want to show 1.234001... etc.

toText doesn't work, because it rounds...
Quote from original Q.
"I want to show 6 decimal places.
If there are not 6 decimal places I want to show only 4."

Have the rules changed?

Pete
Avatar of DeeL9

ASKER

No they have not, I'm in the process of testing.
Though, I think I will up the points because I may have another question.
I think bdreed's way is working.

I'll get back.