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

byte formatting produces unexpected output #761

Open
glorat opened this issue Aug 29, 2024 · 0 comments
Open

byte formatting produces unexpected output #761

glorat opened this issue Aug 29, 2024 · 0 comments

Comments

@glorat
Copy link

glorat commented Aug 29, 2024

    it('should reflect the numbro weirdness', () => {
      const ret = numbro(695751).format({
        output: 'byte',
        base: 'decimal',
        average: true,
        totalLength: 4,
        spaceSeparated: true,
      })
      expect(ret).toBe('0.696 k KB')
    })

It seems that shouldn't be expected. Something like 696 KB or 696.0 KB would make more sense. I've tried different options to workaround this but the extra k is always there.

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

1 participant