Skip to content

standard='iec' is not default anymore #148

@zerkms

Description

@zerkms

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions