mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
feat: add safeRound helper function
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user