1.5.5 • Published 7 months ago

lesca-number v1.5.5

Weekly downloads
3
License
MIT
Repository
-
Last release
7 months ago

React React React React React NPM React NPM

Why use it?

some useful calculation formula.

Live Demo

Installation

npm install lesca-number --save

Usage

As a Node module:

import {
  Pad,
  Uid,
  Dollar,
  CoverSize,
  ValidateEmail,
  ValidatePhone,
  ValidateURL,
} from 'lesca-number';

for (var i = 0; i < 100; i++) {
  let img_url = `./${Pad(i, 4)}.png`;
  console.log(img_url); // => 0001.png ~ 0100.png
}

console.log(Uid(10)); // => c38c995b8d (random)
console.log(Dollar(93848421100)); // => 93,848,421,100
console.log(CoverSize({ width: 720, height: 420 }, { width: 1000, height: 1000 }));
console.log(ValidateEmail('james@gmail.com')); // true
console.log(ValidatePhone('0912345678')); // true
console.log(ValidateURL('https://google.com')); // true

Development

methoddescriptiondefault
.Pad(num:int, max:int):stringthe index of numbersmax = 4
.Uid(len:int):stringlength of numbers10
.Dollar(num:int):string1130200 => 1,130,200
.CoverSize(imageSize:object, containerSize:object):objectcalculator cover size
.ValidateEmail(email:string):booleancheck email format
.ValidatePhone(phone:string):booleancheck Taiwan phone number format
.ValidateURL(url:string):booleancheck url format

Features

  • maintain if necessary
1.5.5

7 months ago

1.5.4

7 months ago

1.5.3

12 months ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.0

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.2

3 years ago

1.0.0

3 years ago