1.0.3 • Published 6 years ago

random-percentage v1.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

random-percentage

Module that will contain a method of random selection and a percentage creation method that will be used together

Install

// npm
npm install -save random-percentage

Use for get random number

random = require('random-percentage');

number = random.getRandom(1,5)
console.log(number); 

use for the creation of percentages

random = require('random-percentage');

// calculate the percentage
if(random.percentage(3,10))
    console.log('TRUE')
else
    console.log('FALSE')

    //OR
var perce = random.getKnowPercentageNumber(3,10);
console.log(perce);
r = random.getRandom(1,100)
console.log(r);
if(r>perce)
    console.log('FALSE')
else if(r<=perce)
    console.log('TRUE')

Autores

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.0

6 years ago