formatla

string formatter


Keywords
separator, format string, parse, number, format, formatter, convert, integer, points, comma, separators
License
MIT
Install
npm install formatla@1.0.2

Documentation

formatla

string formatter

how to install

npm

npm install formatla --save

how to use

node

var formatla = require('formatla');

variables and values

formatla(string, separator, range, startDirection);
separator -> type string -> "any separator/character"
range (separator added to string at every n(range) characters) -> type number or string
startDirection (determines the direction of the start.) -> type string -> "left", "right"

examples

formatla("1000000000", ".", 3, "right"); //1.000.000.000
formatla("1000000000", ".", 3, "left"); //100.000.000.0
formatla("4543123423455678", "-", 4, "left"); //4543-1234-2345-5678
formatla("istanbulturkey", ":", 2, "right"); //is:ta:nb:ul:tu:rk:ey