Connecting Tech Pros Worldwide Forums | Help | Site Map

noob question on trim function with dollarformat function

Newbie
 
Join Date: Feb 2008
Posts: 1
#1: Feb 13 '08
Well anyways, trying to figure out how to properly trim out US currency. I want to take out the $ and the , comma so that I can have my calculation work properly and not to have an error message about my string value.

Newbie
 
Join Date: Feb 2007
Location: Las Vegas, NV - USA
Posts: 17
#2: Feb 13 '08

re: noob question on trim function with dollarformat function


Quote:

Originally Posted by RDpinoy

Well anyways, trying to figure out how to properly trim out US currency. I want to take out the $ and the , comma so that I can have my calculation work properly and not to have an error message about my string value.

If I understand your question right, simply don't use DollarFormat(). DollarFormat is a function that takes a raw integer or floating point value and puts in all the stuff you want to remove.

If I misinterprited your question you can use a regular expressing:

[PHP]<cfset strippedamt=REReplace(amt,"[^0-9.\-]","","ALL")>[/PHP]
Reply