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!

How to convert numbers to text

Status
Not open for further replies.
Dec 18, 2006
69
US
Hi all,

I am on Crystal 2008 and would like to convert my 4-digit decimal numbers to text. This is what I tried before and it didn't work. It always showed 2 digits.
TOTEXT ({sales} / {quantity}, '#.####')

Any advice is greatly appreciated.

Thanks,

TTL101
 
Hi TryingToLearn101

It isn't entirely clear to me exactly what the problem is, but if it is always 4 decimal places you want you could use kray4660's approach or amend your approach to:
TOTEXT ({sales} / {quantity}, '#.0000')

Simialrly, if you wanted 4 digits before the decimal point, and padded with zeros for smaller numbers, you could use:
TOTEXT ({sales} / {quantity}, '0000#.0000')

In other words, replacing the "#" placeholder with "0"s will ensure that it is padded with zeros where necessary.

Hope this helps.
Cheers, Pete


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top