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

String as Currency 1

Status
Not open for further replies.

RP1America

Technical User
Aug 17, 2009
221
US
Greetings!

I am trying to turn the result of a string into currency. I have been able to accomplish this with normal textbox values, however cannot seem to come up with the solution within the string itself.

In the following example of code, "gross" is already coded to produce a value in currency format. Yet, when multiplied by the given number, the result shows up as normal format [i.e. gross($1,000.00) * .5 = 500]. Any ideas?

Code:
    Dim strjscalcpercent As String
    If jspercent = "50%" Then strjscalcpercent = gross * 0.5
    If jspercent = "66%" Then strjscalcpercent = gross * 0.666
    If jspercent = "75%" Then strjscalcpercent = gross * 0.75
    If jspercent = "100%" Then strjscalcpercent = gross * 1

Thanks!!
 
Thanks!!

Works perfectly (except for one minor detail).

strjscalcpercent = Format$(gross * 0.5,"[COLOR=red yellow]$[/color]#,##0.00")


Thanks!!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top