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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Number Truncation/Rounding

Status
Not open for further replies.

cbrittain533

Programmer
Oct 14, 2002
9
US
Is there a simple way (not formula based) to round and then truncate a number for display?

Example: The actual data returned is 18,589,645.89. What I would like to display is 18.6 and then include some reference at the top to indicate that all values are in millions.

I know I could do this with a formula, but there are a lot of fields on this report that require the same thing and I don't want to have to create a formula for every field. I have found the rounding settings just not truncate.
 
Consider using a SQL Expression to handle this for you, here's an example using SQL Server:

round((somenumber * .000001),1

This offloads the task to the database.

In CR, you can round it to the 100,000 place by right clicking and using format field->Number->Customize->Rounding.

Unfortunately this won't allow you to change the precision of the value, as in multiplying it by .000001.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top