Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit 5f6bd1e

Browse files
committed
feat: add helper method for random integer generation
1 parent 798db3a commit 5f6bd1e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

utils/calculation.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ export function calculateUsdFromKsm(ksm: number, price: number): number {
55
export function calculateKsmFromUsd(ksm: number, usd: number): number {
66
return Math.ceil((usd / ksm) * 100) / 100;
77
}
8+
9+
// function includes the lower bound, but excludes the upper bound
10+
export function randomIntegerInRange(min: number, max: number): number {
11+
return Math.floor(Math.random() * (max - min)) + min;
12+
}

0 commit comments

Comments
 (0)