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

Remove Currency Symbol - Formula Calculation

Status
Not open for further replies.

crogers111

Technical User
Jan 23, 2004
158
0
0
US
CR XI
SQL

I have the following formula in a Group Footer:

@% of Spec
totext(({#PaidRT}/{?SpecAmount}) * 100) & "%"

PROBLEM: The output for this formula has a Currency Symbol on the left that I want to remove.

EXAMPLE OF OUTPUT: $12.45%
DESIRED OUTPUT: 12.45%

#PaidRT is a CR Running Total using a Currency Field that Resets in the Group Footer where @% of Spec resides.
?SpecAmount is Number Type parameter

@% of Spec is a String so the standard formatting for a number to remove a currency symbol is not available.
 
i am thinking this may be the hard way to do this,it doesn't look correct to me, but i am not in front of crystal to test it (or test for a better way), so what does this do for you?

totext(RIGHT(({#PaidRT}/{?SpecAmount}) * 100),LEN(({#PaidRT}/{?SpecAmount}))-1) & "%
 
CR returned an error "A String is Required here" because of the RIGHT & LEN functions being peformed on a number.

But I followed your idea and adjusted the formula and appears to be working as I need:

RIGHT(totext(({#PaidRT}/{?SpecAmount}) * 100),LEN(totext({#PaidRT}/{?SpecAmount}))-1) & "%"

Thanks !
 
doh! knew it didn't look quite right.
glad you corrected my mistakes.
 
I think you should just wrap {#paidrt} in tonumber().

totext(tonumber({#PaidRT})/{?SpecAmount}) * 100) & "%"

Or better yet, try:

{#PaidRT} % {?SpecAmount}

Unclick the $ sign and then click on % in the toolbar.

-LB
 
lbass,

I needed to add a ( to your first option but it works great:

totext(tonumber(({#PaidRT})/{?SpecAmount}) * 100) & "%"

That 2nd option is slick and not something I was familiar with. Thanks !
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top