numbro icon indicating copy to clipboard operation
numbro copied to clipboard

byte formatting produces unexpected output

Open glorat opened this issue 5 months ago • 0 comments

    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.

glorat avatar Aug 29 '24 03:08 glorat