Skip to content

Conversation

@philipgiuliani
Copy link

@philipgiuliani philipgiuliani commented Apr 20, 2016

In german we write "1,53 MB" instead of "1.53 MB". I have added the same arguments we have in formatNumber and i'm passing them.

I think for the next major version it would be the best to switch to an options object. That makes it very flexible and will not break the api in future releases in case we change something.

fileSize(fileSize, options = {}) {
    // assign default options
    options = Object.assign({ precision: 2, thousand: ".", decimal: "," }, options);

    // do the rest here
}

// call with:
Humanize.fileSize(1024, { decimal: "." });

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 this pull request may close these issues.

1 participant