Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stop rounding on numeric field

Status
Not open for further replies.

CRCRCR

Technical User
Nov 4, 2007
44
AU
Hi,

I have CR10, on a SQLServer DB, through ODBC

I'd like Crystal to return EXACTLY what is in the database for a numeric field.

To illustrate, I have 2 fields.

R.Formatted_Entry which is a string and R.Entry which is a numeric.

The R.Formatted_Entry displays as it should, i.e exactly what it appears in the DB.
The R.Formatted_Entry is a rounded version of Entry, our application deals with this in a very customised way.

For the (String) field R.Formatted_Entry

2.456 appears as 2.456 in CR
<2 appears as <2 etc..
2 appears as 2
2.000 appears as 2.000

The problem comes when I wish to display the numeric field.

2 should display as 2, not 2.00 in CR
2.00 should display as 2.00
2.45678 should display as 2.45678 not as 2.46
0.003 shuold display as 0.003

No rounding, no extra decimal places, added or removed required. I can't have a fixed decimal places, because that has incorrect implications. I don't want the 2.0 turning into 2.00000 but I do want the 2.45678 to remain as is.

I've tried using the system default, in File, Options, Field, Number. I've tried messing with the decimal places.
I've tried custom formatting the field itself.
I've tried toText etc.. but this still rounds/decimal places the numeric field first.

Noone else seems to have this problem.

Thanks, Kai.

 
I've just had a thought.

Will I have to determine the length of the number, the length of the number after the decimal point, and then set the decimal places accordingly? Thankfully, there is a formula sign next to the decimal places boxes, in the format field box

Has anyone had to do this in the past. Seems a bit tedious just to keep a field as is.

Kai.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top