Created
October 16, 2020 22:44
-
-
Save lamalex/5690235ab00f414fc6fdfadbce960929 to your computer and use it in GitHub Desktop.
Quick function to always print 4 decimal places
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_precision_4(x: float): | |
print(f'{x:.4f}') | |
print_precision_4(123.12345678) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment