Skip to content

Instantly share code, notes, and snippets.

@vlzhr
Created December 25, 2023 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vlzhr/172d6fc51e9a44e2a4fef30e2d593884 to your computer and use it in GitHub Desktop.
Save vlzhr/172d6fc51e9a44e2a4fef30e2d593884 to your computer and use it in GitHub Desktop.
Get pretty number for APY
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