| 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}')
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.