[GH-ISSUE #185] Vertically align size numbers by decimal point #79

Closed
opened 2026-06-08 11:25:35 +03:00 by zhus · 6 comments
Owner

Originally created by @eugenesvk on GitHub (Sep 21, 2021).
Original GitHub issue: https://github.com/bootandy/dust/issues/185

Currently all numbers are right-aligned, so 2 appears to be bigger than 11 as it occupies more space

 2.0M   ├── 2m
  11M   ├── 10m

A better version would look like this, where it's immediately apparent that 11 is bigger than 2 since it's aligned by the decimal point

 2.0M   ├── 2m
11  M   ├── 10m
Originally created by @eugenesvk on GitHub (Sep 21, 2021). Original GitHub issue: https://github.com/bootandy/dust/issues/185 Currently all numbers are right-aligned, so `2` appears to be bigger than `11` as it occupies more space ``` 2.0M ├── 2m 11M ├── 10m ``` A better version would look like this, where it's immediately apparent that `11` is bigger than `2` since it's aligned by the decimal point ``` 2.0M ├── 2m 11 M ├── 10m ```
zhus closed this issue 2026-06-08 11:25:36 +03:00
Author
Owner

@bootandy commented on GitHub (Sep 24, 2021):

I think you raise a good point here. This is worth looking into

What do you think it should do if after the 11 M file there was a 11G file? How do we highlight the 11G is 1000 times bigger than the 11M.

One option is to display Bytes everywhere and then the numbers naturally get larger.

Do you think this would look weird as the numbers don't line up ?

     2.0M   ├── 2m
    11  M   ├── 10m
11      G   ├── 10g

<!-- gh-comment-id:926172865 --> @bootandy commented on GitHub (Sep 24, 2021): I think you raise a good point here. This is worth looking into What do you think it should do if after the 11 M file there was a 11G file? How do we highlight the 11G is 1000 times bigger than the 11M. One option is to display Bytes everywhere and then the numbers naturally get larger. Do you think this would look weird as the numbers don't line up ? ``` 2.0M ├── 2m 11 M ├── 10m 11 G ├── 10g ```
Author
Owner

@eugenesvk commented on GitHub (Sep 24, 2021):

How do we highlight the 11G is 1000 times bigger than the 11M.

  • You do it with custom prefixes https://github.com/bootandy/dust/issues/184#issuecomment-926170025, where you could have
    k
    m
    G
    (and in a proportional font you'd even have a nice differentiation between wider=bigger m and narrower=smaller k)

  • Custom prefixes would also allow to move the prefix around by adding more spaces to make it stand out (btw, it'd be nice to have a space between a number and a prefix as currently they're glued together, which doesn't look nice)
    0 k (one space separator)
    0 m (one space separator)
    0 G (two spaces)
    or make it Gb, also highlights the difference right away
    k
    m
    Gb

  • Or you can use bold G or use a different color

  • or

Do you think this would look weird as the numbers don't line up ?

Not really, though I can achieve the same goal of differentiation with a smaller footprint, so I do prefer that

  • or

One option is to display Bytes everywhere and then the numbers naturally get larger.

That might be the worst option as it introduces a lot of useless numbers (especially if someone forgets to use thousand separator marker), but some might like it just fine

<!-- gh-comment-id:926309169 --> @eugenesvk commented on GitHub (Sep 24, 2021): > How do we highlight the 11G is 1000 times bigger than the 11M. - You do it with custom prefixes https://github.com/bootandy/dust/issues/184#issuecomment-926170025, where you could have `k` `m` `G` (and in a proportional font you'd even have a nice differentiation between wider=bigger **m** and narrower=smaller **k**) - Custom prefixes would also allow to move the prefix around by adding more spaces to make it stand out (btw, it'd be nice to have a space between a number and a prefix as currently they're glued together, which doesn't look nice) `0` ` ` `k` (one space separator) `0` ` ` `m` (one space separator) `0` ` ` ` ` `G` (two spaces) or make it `Gb`, also highlights the difference right away `k` `m` `Gb` - Or you can use **bold** **G** or use a different color - or > Do you think this would look weird as the numbers don't line up ? Not really, though I can achieve the same goal of differentiation with a smaller footprint, so I do prefer that - or > One option is to display Bytes everywhere and then the numbers naturally get larger. That might be the worst option as it introduces a lot of useless numbers (especially if someone forgets to use thousand separator marker), but some might like it just fine
Author
Owner

@bootandy commented on GitHub (Nov 6, 2021):

I tried this with this PR:
https://github.com/bootandy/dust/commit/a2101d89acc723966e92a918c199d17fcac9ea9a

But I'm not really convinced its 'right'

<!-- gh-comment-id:962485301 --> @bootandy commented on GitHub (Nov 6, 2021): I tried this with this PR: https://github.com/bootandy/dust/commit/a2101d89acc723966e92a918c199d17fcac9ea9a But I'm not really convinced its 'right'
Author
Owner

@bootandy commented on GitHub (Nov 6, 2021):

An alternative: I have a build with 'double bars' for the large sub-directories:

https://github.com/bootandy/dust/commit/3e9ba676bf98cd4d00db25e5e3a59beda512b6f8

<!-- gh-comment-id:962486424 --> @bootandy commented on GitHub (Nov 6, 2021): An alternative: I have a build with 'double bars' for the large sub-directories: https://github.com/bootandy/dust/commit/3e9ba676bf98cd4d00db25e5e3a59beda512b6f8
Author
Owner

@bootandy commented on GitHub (Feb 26, 2022):

I'm not going to do this, it would take up too much horizontal space to align all the numbers up.

<!-- gh-comment-id:1051951953 --> @bootandy commented on GitHub (Feb 26, 2022): I'm not going to do this, it would take up too much horizontal space to align all the numbers up.
Author
Owner

@eugenesvk commented on GitHub (Feb 26, 2022):

would take up too much horizontal space to align all the numbers up.

no it wouldn't, see my comment above on how to get the required differentiation without much horizontal space, and anyway, using spaces as the only differentiator that "wastes" space was your idea, not part of my feaure suggestion

<!-- gh-comment-id:1052036304 --> @eugenesvk commented on GitHub (Feb 26, 2022): > would take up too much horizontal space to align all the numbers up. no it wouldn't, see my comment above on how to get the required differentiation without much horizontal space, and anyway, using spaces as the only differentiator that "wastes" space was your idea, not part of my feaure suggestion
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#79