Use
yourNumber.ToString(".00######")
Question
Possible Duplicate:
Display Float as String with at Least 1 Decimal Place
Given the following values:
How can I achieve the following display:
What I am trying to do is force 2 decimal places UNLESS there are more "significant" digits, in which case I'd like to show them as well.
Note: The value is currently stored as a Decimal?
La solution
Use
yourNumber.ToString(".00######")