1 | initial version |
This is a known bug, tracked at
The workaround is to convert to a float:
print(f'{float(val):.2f}')
2 | No.2 Revision |
This is a known bug, tracked at
The workaround is to Two workarounds exist:
either convert to a float:
sage: val = 12.3
sage: print(f'{float(val):.2f}')
or use a raw float from the start
sage: val = 12.3r
sage: print(f'{val:.2f}')