I have some double values I want to convert to a string with this pattern:
0.xx or x.xx
Currently I have try this:
double.ToString("#.#0");
What should I add in order to see zero in case my number start with zero?
I have some double values I want to convert to a string with this pattern:
0.xx or x.xx
Currently I have try this:
double.ToString("#.#0");
What should I add in order to see zero in case my number start with zero?
just use
myDouble.ToString("0.00")
that should do the trick
Put a zero in front of the decimal separator:
double.ToString("0.#0");
This will always include the digit, in contrast to #
which makes it optional.
© 2022 - 2024 — McMap. All rights reserved.