Skip to content

Instantly share code, notes, and snippets.

@konverner
Created January 20, 2023 22:01
Show Gist options
  • Save konverner/daf8b557ab8572cbff53c8e52ae8aa36 to your computer and use it in GitHub Desktop.
Save konverner/daf8b557ab8572cbff53c8e52ae8aa36 to your computer and use it in GitHub Desktop.
alignment and precision in python string formatting
# 12 space symbols to left and 2 numbers after a decimal point
print("{:>12.2f} {:>12.2f}".format(1.32342, 1.9121))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment