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

Commas in formula text field - 6.0 - 8.5

Status
Not open for further replies.

CESHRPR

Programmer
Aug 1, 2002
23
US
Please tell me if this makes any sense at all. The following is a formula for a text field called @credit_total in a 6.0 report. While customer_file.credit_total is a numeric, the formula field has to be a text field in order to populate it with asterisks if the field is too large. I used the exact same formula in an 8.5 report. The 6.0 report has commas in the field where applicable, although how that happened in a text field I'm not sure. These commas do not appear in the 8.5 report. On both reports in design mode, the 'comma' on the tool bar is blocked out. I see nothing in 'format field' that could add commas. What am I missing?

If {CUSTOMER_FILE.CREDIT_TOT} > 999999999999 Then
ReplicateString ("*",15 )
Else
'$' + ToText ({CUSTOMER_FILE.CREDIT_TOT}, 2)

Your ASAP help is appreciated.
 
In version 8 ...
The totext function checks the default number format (file/options field tab, Numbers button) and then uses that to format a number that gets changed to a number. It may not have done that in V6. It's possible that your default for numbers is set to not include the commas.

If you want the commas but don't want to change your defaults, change your formula (in th V8.5) to:
'$' + ToText ({CUSTOMER_FILE.CREDIT_TOT}, 2,",") Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top