Skip to content

Commit

Permalink
Fix 0 bytes display bug (fixes #299)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMStraub committed Oct 30, 2023
1 parent aae12be commit a7f1974
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/components/GrampsjsTreeQuotas.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ function formatBytes(bytes) {
if (bytes === null) {
return null
}
if (bytes === 0) {
return '0 B'
}
const prefixes = ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']
const base = 1000
const exponent = Math.floor(Math.log10(bytes) / Math.log10(base))
Expand Down

0 comments on commit a7f1974

Please sign in to comment.