>>> "{:g}".format(float(214929)/2)
'107464'
>>> "{:g}".format(float(105793)/2)
'52896.5'
I'm trying to print certain numbers in decimal format for small numbers and in scientific notation for large ones.
Why is the format function rounding off certain float divisions to the nearest integers but not others? What am I missing here? I have tried both python2 and 3.