Added number util function for getRandomInt

• Added:
- number util function for getRandomInt
This commit is contained in:
mgabdev 2020-07-28 15:07:55 -05:00
parent 4cb54447f4
commit a38d9f6133

View File

@ -16,3 +16,9 @@ export const shortNumberFormat = (number) => {
</Fragment>
)
}
export const getRandomInt = (min, max) => {
min = Math.ceil(min)
max = Math.floor(max)
return Math.floor(Math.random() * (max - min + 1)) + min
}