Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to control number of fractional digits #62

Merged
merged 11 commits into from
Feb 21, 2021
Prev Previous commit
Next Next commit
Update test.js
  • Loading branch information
sindresorhus authored Feb 21, 2021
commit c7f55a7b75f32abdf12806605d370fa4fd038d0b
2 changes: 1 addition & 1 deletion test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ test('bits and binary option', t => {
t.is(prettyBytes(1e6, {bits: true, binary: true}), '977 kibit');
});

test('fraction digits option', t => {
test('fractional digits options', t => {
t.is(prettyBytes(1900, {maximumFractionDigits: 1}), '1.9 kB');
t.is(prettyBytes(1900, {minimumFractionDigits: 3}), '1.900 kB');
t.is(prettyBytes(1911, {maximumFractionDigits: 1}), '1.9 kB');
Expand Down