Hey guys. Right now I'm trying to figure out how to display a float where it won't show more than two decimals but it also won't show two if it doesn't have to.
Therefore that 0 is meaningful and cannot be omitted. If you request it to print 2 decimal digits, it will print trailing 0, to denote that error is less than 0.5 ULP:
0.3 — actual value is between 0.25 and 0.35
0.30 — actual value is between 0.295 and 0.305
See how that extra digit changes precision?
If you still want to cut away trailing zeroes, print number to string, and cut trailing zeroes manually.