trevorhartman
asked on
parsing dollar values - URGENT
Hi,
I have a string = to a dollar value. eg:
string dollars = "$15.45";
how do I parse it into a decimal?
i want:
decimal decPrice == 15.45;
but i want to do it by parsing the string into a decimal.. do I use an Iformatprovider or something? please give an example, i don't know how to use iformatprovider
thanks
-Trevor
I have a string = to a dollar value. eg:
string dollars = "$15.45";
how do I parse it into a decimal?
i want:
decimal decPrice == 15.45;
but i want to do it by parsing the string into a decimal.. do I use an Iformatprovider or something? please give an example, i don't know how to use iformatprovider
thanks
-Trevor
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thx for the suggestions guys, but i'm still wondering on the IFormatProvider thing...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks tushar.
this did it for me:
double dollars = double.Parse("$13.40", NumberStyles.Currency);
-Trevor
this did it for me:
double dollars = double.Parse("$13.40", NumberStyles.Currency);
-Trevor
Nice to have you going!
Thanks for A
-tushar
Thanks for A
-tushar
ASKER
-Trevor