Skip to content

Commit

Permalink
Add precision for units from zero (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
szeidat authored Jul 20, 2024
1 parent aeb9f04 commit 05b8db0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ByteSize {
maximumFractionDigits: options.precision
})
const value = units.from === 0
? prefix + bytes
? prefix + defaultFormat.format(bytes)
: prefix + defaultFormat.format(bytes / units.from)
this.value = value
this.unit = units.unit
Expand Down

0 comments on commit 05b8db0

Please sign in to comment.