I am using the following code to show percentage using String.Format but I also want to limit the number of significant figures to 2, the two don't seem to play well together. How can I get the two working together properly?
String.Format("% Length <= 0.5: {0:0%}", m_SelectedReport.m_QLT_1);
So what I ideally want is something like this
double d1 = 1234;
double d2 = 0.1234;
//Output of d1 -> 12
//Output of d2 -> 0.12
You can control the number of digits before and after the decimal point (separator). Controlling the total number of digits (before and after) is going to require some programming.
The format {0:0.00%}
ought to work, giving outputs like 0.12, 1.23 and 12.34