plotset-formatter
v1.2.149
Published
[![NPM version](https://img.shields.io/npm/v/plotset-formatter)](https://www.npmjs.com/package/plotset-formatter)
Downloads
218
Readme
plotset-formatter
node.js:
npm install plotset-formatter
Usage examples
getType
// node.js, "classic" way:
var { getType } = require("plotset-formatter");
//for detect the input type
getType("123");
//return string-number-date
getColumnsType
// node.js, "classic" way:
var { getColumnsType } = require("plotset-formatter");
//for detect type of columns in data
getColumnsType(arrayData, arrayColumns);
// return {
// string: [col1,col2,col4],
// date: [col2,col5],
// number: [col6],
// }
Number
parser
getRadixCharacter
// node.js, "classic" way:
var {getRadixCharacter}=require("plotset-formatter")
//for detect floating point array number
getRadixCharacter(["3,828.071","330,887.468",...]);
// return '.', ',', '/'
parseNumber
// node.js, "classic" way:
var { parseNumber } = require("plotset-formatter");
//for formatted numbers
parseNumber(input, (radixCharacter = "."), (forceMode = false));
// return 100k=>100000,
Formatter
numberFormatter
// node.js, "classic" way:
var {numberFormatter}=require("plotset-formatter")
//for formatted numbers
const numberFormatter(number,pattern);
//pattern=>0.00,number=>100
// return=>100.00,
Date
parser
checkDayIsAtFirst
// node.js, "classic" way:
var { checkDayIsAtFirst } = require("plotset-formatter");
//for detect date pattern and check :dd-mm-yyy or mm-dd-yyy or mm-yy or mm-dd
checkDayIsAtFirst();
// return false or true
parseDateTime
// node.js, "classic" way:
var { parseDateTime } = require("plotset-formatter");
//for formatted date
parseDateTime(input, (dayIsAtFirst = false));
// return feb 13 => iso time ,
Formatter
dateFormatter
// node.js, "classic" way:
var {dateFormatter}=require("plotset-formatter")
//for formatted date
const dateFormatter(date,pattern);
//pattern=>YYY,date=>ISO Time
// return=>1986