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

How do I trim a string result to 2 decimals? 1

Status
Not open for further replies.

cjbrown815

IS-IT--Management
Mar 2, 2006
525
US
I have a manual crosstab report. I have a formula field and then a running total using the formula field. It is returning a string, but the result is numeric (so I can't just set the decimal places in the field formating). Sometimes the results a XX.XX and sometimes they are 00.0000. I need all results regardless to show a numeric format of two decimal places.

Thank you,

Formula:

if {SAMPLEPARAM.PA_NAME} in ["Foss Foodscan Calc Total Solid","AVG Total Solids"] then
{SAMPLEPARAM.SRESULT}


-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
You can use->format field->common tab->display string->x+2:

totext(val({yournumerictextresults}),2,"")

-LB
 
Thanks again :)

-CJ

SQL2005// CRXIr2// XP Pro

"Progress lies not in enhancing what is, but in advancing toward what will be"
-KHALIL GIBRAN 1883-1931
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top