I have a double and I want to format it with the following rules:
- If there are no decimal places show just the number (see 100 example below)
- If there are any decimal places show 2 decimal places
So, as a few examples:
100 --> 100
99.958443534 --> 99.96
99.1 -> 99.10
You can use: