Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I convert a currency string like $1,248.99 to a decimal in C#? [duplicate]

Tags:

c#

Possible Duplicate:
Convert any currency string to double

How do I convert a currency string like $1,248.99 to a decimal in C#?

like image 756
FrankTheTank Avatar asked Dec 05 '25 00:12

FrankTheTank


1 Answers

You could try this:

var value = double.Parse(currency, NumberStyles.Currency);
like image 54
Sani Singh Huttunen Avatar answered Dec 07 '25 14:12

Sani Singh Huttunen