0.2.0 • Published 7 years ago

your-rand-int v0.2.0

Weekly downloads
52
License
MIT
Repository
github
Last release
7 years ago

your-rand-int

npm i your-rand-int

randInt(min, max)

获取指定范围的随机整数

import randInt from 'your-rand-int'

// 正常传入 [10, 20]
randInt(10, 20)

// 支持负数 [-10, 20]
randInt(-10, 20)

// 从大到小 [20, 30]
randInt(30, 20)

// 带小数和字符串的参数,会自动转为整数 [-1, 3]
randInt(3.1, '-1.2')
0.2.0

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago