Below is some float value:
5.3 23.67 0.23
and I want them to be
05.30 23.67 00.23
Using String(format: "%.2f", floatVar) can do 2 digits after the decimal point, but cannot add a zero in front of it.
I also tried String(format: "%04.2f", floatVar) as suggested here , but it just displays the same as %.2f
Is there a clean way to do this in standard Swift libraries?
source share