0.5.1 • Published 1 year ago

@usesummit/utils v0.5.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Summit JS Utils

Useful methods for handling numbers, mostly.

Came out of the need for re-using some helper methods across multiple codebases at Summit.

Contents

  • calculateHumanReadableNumber turns a number into a [number, abbreviation] tuple, so that you can pass the number to any number formatter and then add the abbreviation as a suffix. You can use this to pretty-print 47965012.48 to 47.96MM. This doesn't handle rounding or fraction digits, use your regular number formatter for that (i.e. Intl.NumberFormat)
  • parseHumanReadableNumber can parse numbers like 1.52MM and 1,234,456.78 to floats
  • getIdentifier generates and stores a unique identifier so you can anonymously identify users or sessions
0.3.0

1 year ago

0.2.7

1 year ago

0.2.8

1 year ago

0.5.0

1 year ago

0.4.1

1 year ago

0.3.2

1 year ago

0.4.0

1 year ago

0.3.1

1 year ago

0.5.1

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.0

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago