1.0.1 • Published 7 years ago

@splash-cli/unit-formatter v1.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

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