I found a lot of material for formatting floats to regular known numbers, but how can I format a float to max. 2 decimal places, but only if decimal places are needed?
Examples:
1.11 # not 1.111 1.12 # it was 1.116 (round up) 1.1 # not 1.10 1 # not 1.00
if i do
$('{0:N2}' -f $flt)
I get
1.00 # :(
Thanks in advance!
floating-point format powershell
gooly
source share