Is there a simple way to format a number to show at least n decimals ? If possible, using string templates and avoiding processing the string with code.
Expected results for 2 wanted decimals:
| Value (type f) | Expected output |
|---|---|
| 4 | 4.00 |
| 0.4 | 0.40 |
| 0.04 | 0.04 |
| 0.004 | 0.004 |
| 0.0004 | 0.0004 |
I've only found ways to specify fixed decimal precision through string templates.