Created
May 17, 2018 11:08
-
-
Save hwshim0810/6eb98c9999a24cfad360449591bdd473 to your computer and use it in GitHub Desktop.
Get if int or rounded float
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 get_if_int_or_float(value, under_num=1): | |
return int(value) if value.is_integer() else round(value, under_num) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment