web_lib

Common web application libraries
git clone https://radroots.dev/git/web_lib.git
Log | Files | Refs | LICENSE

commit 32abad61ff9d20265bc932672c05e892490c087b
parent 642c1def6e899f383293045423009ddb471a4e20
Author: triesap <137732411+triesap@users.noreply.github.com>
Date:   Thu, 14 Nov 2024 21:37:23 +0000

utils: add math utils

Diffstat:
Mutils/src/math.ts | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/utils/src/math.ts b/utils/src/math.ts @@ -2,4 +2,6 @@ export const round_to_5 = (num: number): number => { return Math.round(num / 5) * 5; }; -export const num_str = (num: number): string => num.toString(); -\ No newline at end of file +export const num_str = (num: number): string => num.toString(); + +export const num_min = (num: number = 0, num_min: number = 0): number => Math.max(num, num_min); +\ No newline at end of file