console icon indicating copy to clipboard operation
console copied to clipboard

Reduce the number of digits shown in UI

Open carllerche opened this issue 3 years ago • 4 comments

It probably doesn't make much sense to include fractions in the numbers displayed in the UI.

ref: https://news.ycombinator.com/item?id=29596537

carllerche avatar Dec 17 '21 19:12 carllerche

I think we probably do want one or two fractional digits, at least for larger units like seconds, but definitely not 4 like we have currently.

hawkw avatar Dec 17 '21 19:12 hawkw

Can we just vary the fraction so that we aim for 3 significant figures total when the non-fractional part is less than 1000? (And when its >= 1000, then the fractional part should be hidden.)

Is that the wrong way to look at this?

pnkfelix avatar Dec 17 '21 19:12 pnkfelix

not directly related, but we probably also want to format durations over one or two minutes as minutes + seconds, rather than as a large number of seconds, which it looks like std::time::Duration's fmt::Debug implementation doesn't do. So, at some point, we're definitely going to end up writing our own duration formatter, and we can probably implement significant figures logic there as well?

hawkw avatar Dec 17 '21 20:12 hawkw

I think we probably do want one or two fractional digits, at least for larger units like seconds, but definitely not 4 like we have currently.

Depends... 5m20s maybe, but 3.245ms... probably not. I think 3ms would make more sense there.

carllerche avatar Dec 17 '21 20:12 carllerche