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

standard='iec' is not default anymore #148

Closed
zerkms opened this issue May 18, 2022 · 2 comments · Fixed by #149
Closed

standard='iec' is not default anymore #148

zerkms opened this issue May 18, 2022 · 2 comments · Fixed by #149

Comments

@zerkms
Copy link

zerkms commented May 18, 2022

The check is defined as:

standard = base === 2 ? descriptor.standard || "iec" : "jedec";

Which reads - if only base equals 2 - take the descriptor.standard. But base default value is 10.

Hence

filesize(265318, { standard: 'iec' });              

would output "265.32 kB"

So it means:

  1. The readme is not entirely correct in its "(string) Standard unit of measure, can be iec or jedec, default is iec; can be overruled by base"
  2. standard option does nothing if base is not specified
@avoidwork
Copy link
Owner

yup, this is what people wanted for the last major release. i believe it was a mistake.

@avoidwork
Copy link
Owner

originally fixed with bb72429 and then undone with afd78c2 which i have no idea atm; however i completely agree what it's configured to do right now is inane.

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

Successfully merging a pull request may close this issue.

2 participants