1.0.0 • Published 9 years ago

align-dots v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

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.

OptionDefaultDescription
forceDotsfalsePrint dots for all numbers (except they're all integers).
char" "Padding character.
zeroesfalseImplies { forceDots: true, char: 0 }.

Install

npm install align-dots

License

MIT