align-dots

1.0.0 • Public • Published

npm

align-dots

Build Status Dependency Status

Align numeric data by decimal dot.

Example

var align = require('align-dots');
 
align(['.25', '0.5', '1.005', '10'])
//=> ['  .25 ',
//    ' 0.5  ',
//    ' 1.005',
//    '10    ']);

API

align(data, [opts])

Align array of numbers (strings), return array of aligned strings.

Option Default Description
forceDots false Print dots for all numbers (except they're all integers).
char " " Padding character.
zeroes false Implies { forceDots: true, char: 0 }.

Install

npm install align-dots

License

MIT

Package Sidebar

Install

npm i align-dots

Weekly Downloads

3

Version

1.0.0

License

MIT

Last publish

Collaborators

  • eush77