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

group names to text 1

Status
Not open for further replies.

Halfcan

Technical User
Dec 8, 2002
214
US
Hi
I have a group that is a number example: 98.987

I would like to display a % sign in the tree on the left when previewing the report.

I think I am close with something like
totext({field},"")

can anyone explain the rules for totext?

Thanks,
Andy
 
The following examples are applicable to both Basic and Crystal syntax:

CStr ({Orders.Shipped})

Returns "True" if the value of {Orders.Shipped} is True.

CStr(123.45)

Returns "123.45".

CStr(12345.6749,2)

Returns "12345.67".

CStr(12345.6750,2)

Returns "12345.68".

CStr(12345.4999,0)

Returns "12345".

CStr(12345.5000,0)

Returns "12346".

CStr({file.AMT} * {file.QUANTITY})

Returns "44,890.20" where Amt = 24.45 and Quantity = 1836.

CStr is useful when you want to build a sentence by combining (concatenating) a converted number or other value with other text strings:

"The base price of item # " + {file.ITEM NUMBER} + " is $" + CStr({file.BASE PRICE}) + "."

Prints the sentence "The base price of item A1/4520/B12 is $50.00." where the Item number is A1/4520/B12 and the Base Price is 50.00, converted to text and formatted with two decimal places.

CStr(CDate(1996, 11, 1), "yy MMM dd, dddd")

Returns "96 Nov 01, Monday".

CStr(CDateTime(1995,10,12,3,30,11),"HH:mm, yy MMMM ddd")

Returns "03:30, 95 October Mon".

CStr(CTime(12, 10, 10), "HH*mm*ss tt", "amStr", "pmStr")

Returns "12*10*10 pmStr".

 
This should work:

"%"+totext(22985.346,3,"")

The 3 states decimal places, the "" states the 1000's separator.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top