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

Convert Number to Text 4

Status
Not open for further replies.

rewob65

Technical User
Nov 13, 2004
110
0
0
GB
Can I convert a number to text I use crystal 8.5.


Thanks
 
I am converting to text not to a number, I thought it may be tostring
 
If you want to convert 541 to '541' then you can use ToText() or Cstr(), but if you wish to convert 541 to Five Hundred and Forty One then that's a completely different story. Which do you want ?



Gary Parker
MIS Data Analyst
Manchester, England
 
The first. Thanks Gary, Your help today and yesterday has been really good. Out of interest is there any easy way to do the second example.
 
The ToWords() function appeared in Version 8.5

ToWords(541,0)

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Hi there, I am new to Crystal Reports and would like to know if it is possible to enter a formula where if a date is blank it can be replaced with the text "tba".

Many thanks
Bejay 1066
 
Try this:

if isnull({table.date}) then
"tba"
else
{table.date}

~Brian
 
Brian's solution would work if the date was a string. Otherwise, you could change it to:

if isnull({table.date}) then
"tba"
else
totext({table.date},"MM/dd/yyyy") //format as you wish

-LB
 
I am new to Crystal Reports (from Oracle Reports). I am attempting to pad a string. I have a dollar amount e.g. 1123.44 and need to pad it to 0000123.44. In Oracle this is easy. Is there Crystal function that will do this? Also, is there a trick to converting a number to text? When I use ToText(), I get 1,234.44. I don't want the comma.
 
With totext(), you can add two arguments, one for the number of decimals, and one to remove the dividing comma, by using:

totext({table.number},0,"")

To pad a number, you could also use the following:

totext({Table.number},"0000000.00")
//adding the number of places you want to the left or right of the
//decimal by adding additional zeros

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top