D David Dvali Oct 3, 2005 #1 How can I convert decimal value exactly to such format "0.00" (exactly with dot, with ignoring of regional settings)?
How can I convert decimal value exactly to such format "0.00" (exactly with dot, with ignoring of regional settings)?
M Marcus Andrén Oct 3, 2005 #2 How can I convert decimal value exactly to such format "0.00" (exactly with dot, with ignoring of regional settings)? Click to expand... Decimal d1 = 1.25M; string result = d1.ToString("0.00",System.Globalization.CultureInfo.InvariantCulture);
How can I convert decimal value exactly to such format "0.00" (exactly with dot, with ignoring of regional settings)? Click to expand... Decimal d1 = 1.25M; string result = d1.ToString("0.00",System.Globalization.CultureInfo.InvariantCulture);
O Oliver Sturm Oct 3, 2005 #3 David said: How can I convert decimal value exactly to such format "0.00" (exactly with dot, with ignoring of regional settings)? Click to expand... The best way to export data to string formats in a culture independant way is to use the so-called InvariantCulture. Like this: decimal val = 33.7m; string strval = val.ToString(CultureInfo.InvariantCulture); Here (MSDN) is more information about this: http://shrinkster.com/8fw Oliver Sturm
David said: How can I convert decimal value exactly to such format "0.00" (exactly with dot, with ignoring of regional settings)? Click to expand... The best way to export data to string formats in a culture independant way is to use the so-called InvariantCulture. Like this: decimal val = 33.7m; string strval = val.ToString(CultureInfo.InvariantCulture); Here (MSDN) is more information about this: http://shrinkster.com/8fw Oliver Sturm