Last active
January 18, 2023 02:17
-
-
Save dustinboswell/42a5a671792e9262b0d35397a9c9d951 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
private static string GetPercentageRounds(double percentage) { | |
percentage = Math.Clamp(percentage, 0.0, 1.0); | |
int numFilled = Math.Ceiling(percentage * 10); // A value from 0 to 10 inclusive. | |
const string dots = "🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵⚪⚪⚪⚪⚪⚪⚪⚪⚪⚪"; | |
return dots.Substring(10 - numFilled, 10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment