mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-10 17:43:51 +00:00
Refactored many helpers to Typescript
This commit is contained in:
7
src/utils/helpers/numbers.ts
Normal file
7
src/utils/helpers/numbers.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
const TEN_ROUNDING_NUMBER = 10;
|
||||
const { ceil } = Math;
|
||||
const formatter = new Intl.NumberFormat('en-US');
|
||||
|
||||
export const prettify = (number: number) => formatter.format(number);
|
||||
|
||||
export const roundTen = (number: number) => ceil(number / TEN_ROUNDING_NUMBER) * TEN_ROUNDING_NUMBER;
|
||||
Reference in New Issue
Block a user