Jul
5
2013
C#

How to convert from string currency to double in C#

Follow one simple line of C# code to convert from a string currency to double. 

var strCurrency = "$103,02.54";
var dOutput = double.Parse(strCurrency, NumberStyles.Currency);



dOutput is now holding value: 10302.54

NumberStyles.Currency using have namespace: using System.Globalization;

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Calendar

<<  April 2020  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

View posts in large calendar