Is that possible in C# to format
4.52 float number to 4.52 string
and
4.520 float number to 4.52 string, i.e. omitting tail zeros?
EDIT: I think I've not accented the real problem. I need ONE pattern that conforms BOTH of the above examples!
Assuming you want to omit any trailing 0's from your value, this should give you what you want:
ToString("0.####")
Otherwise you could do:
ToString("0.00##")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With