hi zlf,
I have done something like this. Hope this helps!
// Gets a NumberFormatInfo associated with the en-US culture.
NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat;
double myInt = 123;
nfi.CurrencySymbol = "$";
//This will show the number formatted with $
Console.WriteLine(myInt.ToString( "C", nfi ));
//This will convert back the curreny amout without the $ symbol
Console.WriteLine(myInt.ToString( "N", nfi ));
Note: I have used Winform to test this code.
happy programming
pradeep_TP
zlf said:
1?¡éHere is a number. double nu = 123
2?¡éFormat it with [NumberFormatInfo]
3?¡éThe result is "$123"
I want to ask how to deformat "$123" to 123
Thx
(Currency symbol is not restricted to '$')