Hey there, I’m trying to format a number like… For example if it’s 26.63, I need the output to be 26.6… If the number is 8.45, I need to show 8.4, and if it’s “0”, display 0.0… I’m doing like the following;
fmt.Sprintf("%2.1f", 26.636)
The above example works and displays the expected result, but if I try to format a 0 number like;
fmt.Sprintf("%2.1f", 0)
It displays smth like; %!f(int= 0)
Anyone know where is the error?
Tnx.