0

I am building some UI for an education app displaying user progress in percentages. Have run into an issue with rounding: 0.4 rounds down to 0, but that isn't meaningful to the user who feels they have definitely completed more than 0% of their task. Ditto for 100%: 99.5% rounds up to 100%, but obviously you're only completely done when you're completely done.

I've solved this issue in a clunky programmatic way using floor() and a special condition to round up to 1 for > 0 & < 1, so this is more of a curiosity than an urgent question, as I'm not enough of a math person to know an algorithmic solution. One might say I'm neither 100% nor 0% of a math person: I know enough to know there is probably some cute and clever name for this issue, but I don't know what it is.

It seems sort of related to "banker's rounding" and sort of related to this stuff. But it's not exactly either of those things, I don't think?

In other words, when is something more than nothing, and when is everything not enough? If it helps at all, one time I tried to read Gödel, Escher, Bach, but then I read Debt by David Graeber instead.

Thanks! =)

  • This isn't related to bankers rounding. I think you just need to choose whether there's some non-zero, non-100 value that should be used for the cases that would round to these values (which I guess is what your special condition does) or alternatively you just don't apply rounding at all for values close to 0 and 100 (again you need to choose a threshold to define what "near" means in that case) – ROX Jul 15 '21 at 16:56
  • 1
    You could read [UX: What topics can I ask about here?](https://ux.stackexchange.com/help/on-topic) and [UX: What types of questions should I avoid asking?](https://ux.stackexchange.com/help/dont-ask) to see if your question would be better there. – Andrew Morton Jul 15 '21 at 17:01
  • @ROX yeah that is what i did! =) i'm just curious if there's a name/concept for this issue, which i'm guessing many people have run into before me? – Mike Young Jul 15 '21 at 17:05
  • Although not to do with rounding, more to do with including values that are close-to-but-not-including the limits, the difference between the mathematical concepts of "open intervals" and "closed intervals" is somewhat related to your aim. I have certainly encountered the requirement before, but not had a name for it. – ROX Jul 16 '21 at 15:05
  • 2
    One idea would be to round towards 50%. You could do this by subtracting 50, round toward zero, and add 50. – Nate Eldredge Jul 16 '21 at 18:26

0 Answers0