Clamp a number between a min and max value.
the number to clamp
the minimum value
the maximum value
the clamped value
import { clamp } from "@trashpanda001/helpers/number"clamp(5, 0, 10)// 5clamp(-5, 0, 10)// 0clamp(15, 0, 10)// 10 Copy
import { clamp } from "@trashpanda001/helpers/number"clamp(5, 0, 10)// 5clamp(-5, 0, 10)// 0clamp(15, 0, 10)// 10
Clamp a number between a min and max value.