Search code examples
c#devexpress

How to force trailing zero in numeric format string?


I need to display float as

1.00
1.50
1.55
1.60

The following is what I see using f2 format.

1.
1.5
1.55
1.6

Is there a way to force the trailing 0 to appear?

(I'm using a DevExpress SpinEdit control and trying to set the display and edit format.)


Solution

  • yourNumber.ToString("N2");