Created
December 25, 2023 12:13
-
-
Save vlzhr/172d6fc51e9a44e2a4fef30e2d593884 to your computer and use it in GitHub Desktop.
Get pretty number for APY
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 prettify_apr(n): | |
return prettify_number(n * 100) + "%" | |
def get_pretty_apy(apr): | |
apy = (1 + apr / 365) ** 365 - 1 | |
return prettify_apr(apy) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment