How can I format a float so that it doesn\'t contain trailing zeros? In other words, I want the resulting string to be as short as possible.
For example:
<
You can achieve that in most pythonic way like that:
python3:
"{:0.0f}".format(num)