A bit easier than what DParsons suggested is simply:
Code:
ugly = "USD1.30"
pretty = Mid( ugly, 4 )
No reason to use RIGHT, which requires getting the length and then subtracting 3.
Just *start* at the character after the "USD" and presto.
*** HOWEVER ***
Is this REALLY a good idea????
What happens if at some point your "feed" changes and starts giving you
USD 3.38
or
$3.38
or
3.38 USD
or
3.38 US$
????
I think a much better way is to use a regular expression to strip out all of the characters that are not part of the actual numerical value. Thus:
Code:
<%
...
Set reZap = New RegExp
reZap.Pattern = "[^\d\.\-]"
reZap.Global = True
ugly = "USD78.31"
pretty = CDbl( reZap.Replace( ugly, "" ) ) ' and SHOULD convert to a number when you do this!
...
%>
You can use CCur( ) in place of CDbl( ), if you wish. But in any case, stop carrying the number around as a string. (EXCEPTION: If you will then *ONLY* Response.Write the value, you can leave it as a string. But if you do *ANY* calculation with it--or if you store it in a DB--be sure to convert it to a number.)