feat: add safeRound helper function

This commit is contained in:
ValdiANS
2026-01-23 15:59:31 +07:00
parent 28b58d9cac
commit ed9a8021c1
+5
View File
@@ -31,6 +31,11 @@ export const formatNumber = (
}).format(value);
};
export const safeRound = (num: number, decimals: number) => {
const factor = 10 ** decimals;
return Math.round((num + Number.EPSILON) * factor) / factor;
};
export const formatTitleCase = (value: string) => {
return value
.toLowerCase()