I have some decimal data that I am pushing into a SharePoint list where it is to be viewed. I\'d like to restrict the number of significant figures displayed in the result
This might do the trick:
double Input1 = 1234567;
string Result1 = Convert.ToDouble(String.Format("{0:G3}",Input1)).ToString("R0");
double Input2 = 0.012345;
string Result2 = Convert.ToDouble(String.Format("{0:G3}", Input2)).ToString("R6");
Changing the G3 to G4 produces the oddest result though. It appears to round up the significant digits?