In C#, I have some decimal variables with values > 0 and some equal to 0. I get these decimals from number of different text boxes on a C# winform.
What is best practice for counting how many of them have values > 0?
If the count is > 12, The variables that have the lowest values, (only the values that are non-zero) should be changed to 0
It isn’t an award-winning piece of object-oriented software engineering, but it should do the job:
It uses collections. I’d recommend you to use them too, however. Using a lot of numbered different values is a code smell, and barely too handy I guess.