Skip to content

eush77/align-dots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Align numeric data by decimal dot

Resources

License

Stars

Watchers

Forks

Packages

No packages published