@splash-cli/unit-formatter

1.0.1 • Public • Published

unit-formatter

Format numbers by adding 'b/k/m' at the end. 1000 => 1k

Install

	$ npm install @splash-cli/unit-formatter --save

	#or

	$ yarn add @splash-cli/unit-formatter

Usage

	import uFormatter from '@splash-cli/unit-formatter';

	console.log( uFormatter(1000) ); //=> '1k'

Api

uFormatter(num)

Returns formatted number into a string.

num

Type: Number Number to be formatted

License

MIT © Federico Vitale

Package Sidebar

Install

npm i @splash-cli/unit-formatter

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

115 kB

Total Files

8

Last publish

Collaborators

  • rawnly