Percentage Rounds Function
private static string GetPercentageRounds(double percentage) { if (percentage == 0) return "○○○○○○○○○○"; if (percentage > 0.0 && percentage <= 0.1) return "🔵○○○○○○○○○"; if (percentage > 0.1 && percentage <= 0.2) return "🔵🔵○○○○○○○○"; if (percentage > 0.2 && percentage <= 0.3) return "🔵🔵🔵○○○○○○○"; if (percentage > 0.3 && percentage <= 0.4) return "🔵🔵🔵🔵○○○○○○"; if (percentage > 0.4 && percentage <= 0.5) return "🔵🔵🔵🔵🔵○○○○○"; if (percentage > 0.5 && percentage <= 0.6) return "🔵🔵🔵🔵🔵🔵○○○○"; if (percentage > 0.6 && percentage <= 0.7) return "🔵🔵🔵🔵🔵🔵🔵○○○"; if (percentage > 0.7 && percentage <= 0.8) return "🔵🔵🔵🔵🔵🔵🔵🔵○○"; if (percentage > 0.8 && percentage <= 0.9) return "🔵🔵🔵🔵🔵🔵🔵🔵🔵○"; return "🔵🔵🔵🔵🔵🔵🔵🔵🔵🔵"; }
A code snippet shows a C# function that converts a percentage into a row of ten empty or blue circles. The joke is that the function painstakingly handles every tenth interval with repetitive conditionals, making a simple progress indicator absurdly verbose. It is a reaction for overengineered, inefficient, or unnecessarily complicated code. EN: A code snippet shows a C# function that converts a percentage into a row of ten empty or blue circles. The joke is that the function painstakingly handles every tenth interval with repetitive conditionals, making a simple progress indicator absurdly verbose. It is a reaction for overengineered, inefficient, or unnecessarily complicated code.
- @pokupkabitka / 21187 2023-01-18
- Type
- image
- Size
- 674×800 · 107.1 KiB
- Mood
- sarcastic, absurd
- Language
- en
- Added