forked from Shinonome/dots-hyprland
sideleft: new tool: conversions
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
|
||||
export function clamp(x, min, max) {
|
||||
return Math.min(Math.max(x, min), max);
|
||||
}
|
||||
|
||||
export function truncateToPrecision(value, precision) {
|
||||
const factor = Math.pow(10, precision);
|
||||
const result = Math.round(value * factor) / factor;
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user