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

crystal formula

Status
Not open for further replies.

needmoremoney

Technical User
Mar 30, 2005
123
US
I'm having a problem. Below is the statement.

whileprintingrecords;
numbervar currlength := length(totext({temp401KReport.currEePreTax}*100,"000000000"));
stringvar ContAmt := totext({temp401KReport.currEePreTax}*100,"000000000");

The number comes up 000000000 or 000000034 and -000000005.
I need to limit the output to only nine characters even if there is a negative number.

Any help thanks..
 
So you do or do not want to show the negative number?

Why not post what you need rather than what isn't correct?

Anyway, try using a conditional on each using the brute force method:

whileprintingrecords;
if {temp401KReport.currEePreTax} < 0 then
stringvar ContAmt := totext({temp401KReport.currEePreTax}*100,"00000000")
else
stringvar ContAmt := totext({temp401KReport.currEePreTax}*100,"000000000");

-k
 
Hello,

Thanks a million, that worked.

Onemore thing though. Should I stick with the stringvar ContAmt or the numbervar currlength?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top