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

Formatting to bits does not output thousands properly #84

Closed
ussuritiger opened this issue Jan 23, 2017 · 2 comments
Closed

Formatting to bits does not output thousands properly #84

ussuritiger opened this issue Jan 23, 2017 · 2 comments

Comments

@ussuritiger
Copy link

I am using the 3.4.2 version of package. I've got an issue while formatting bits. Please see the code and the output below.

filesize(124, {bits: true, base: 10}) // "992 b"
filesize(125, {bits: true, base: 10}) // "1000 b" => I would expect "1 kb"
filesize(126, {bits: true, base: 10}) // "1.01 kb"

Same goes for other thousands:
filesize(125000, {bits: true, base: 10}) // "1000 kb" => I would expect "1 Mb"
filesize(125000000, {bits: true, base: 10}) // "1000 Mb" => I would expect "1 Gb"

Hope it does not require much time to fix this. Thank you.

@avoidwork
Copy link
Owner

all this time, i thought no one used that flag. looks like it doesn't +1 when it should. i'll take a look.

@ussuritiger
Copy link
Author

Apparently there are people who use this flag :) Moreover, it is hard to find a library that operates with bits. So this makes the library even greater. Keep up the good work and thanks for the quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants