N
Next
hello
I am trying to format numbers coming from a datareader using the code below.
But it is not working.
How do I format decimal places? Thanks in advance!
NumberFormatInfo numFormat = new NumberFormatInfo();
numFormat.NumberDecimalDigits = numFormat.CurrencyDecimalDigits =
Convert.ToInt16(dr["decimal_places"]);
Double myDouble = Double.Parse(dr["number"].ToString(),numFormat);
I am trying to format numbers coming from a datareader using the code below.
But it is not working.
How do I format decimal places? Thanks in advance!
NumberFormatInfo numFormat = new NumberFormatInfo();
numFormat.NumberDecimalDigits = numFormat.CurrencyDecimalDigits =
Convert.ToInt16(dr["decimal_places"]);
Double myDouble = Double.Parse(dr["number"].ToString(),numFormat);