1.0.0 • Published 9 years ago
align-dots v1.0.0
align-dots
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
1.0.0
9 years ago