I have a requirement to format a given number to at least 1 decimal place and up to 2 decimal places as in:
4 -> 4.0
4.1 -> 4.1
4.25 -> 4.25
4.3333 -> 4.33
4.5 -> 4.5
5 -> 5.0
Is there a FormatString string which will deliver this?
as in:
MyDecimal.ToString("[something here]")
Yes, you can conditionally include a second decimal place with the
#format placeholder.