Created
July 1, 2024 18:46
-
-
Save fastfingertips/46a9f06aee27a43b0b27a0afa50e4d2d to your computer and use it in GitHub Desktop.
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 percent(progress, total): | |
return round(99 * progress / total + 0.5) | |
percent(0, 1000) | |
percent(1, 1000) | |
percent(999, 1000) | |
percent(1000, 1000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment