Skip to content

significant digits? #17

@cainlevy

Description

@cainlevy

I would like to specify a maximum number of significant digits for a number, so that I may better estimate how much space to allocate in design. Currently I may only specify precision and control decimals.

Currently:

  • millify(123456, {precision: 2}) returns 123.45K

Proposed:

  • millify(123456, {digits: 3}) returns 123K
  • millify(1234, {digits: 3}) returns 1.23K.

I'm willing to work on a patch if this is in scope for millify.

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