projects overview and event list improvements

This commit is contained in:
Carl-Gerhard Lindesvärd
2024-03-09 21:53:40 +01:00
parent 79d2368cfc
commit faafb71d88
16 changed files with 585 additions and 59 deletions

View File

@@ -8,10 +8,8 @@ export function fancyMinutes(time: number) {
return `${minutes}m ${seconds}s`;
}
export function useNumber() {
const locale = 'en-gb';
const format = (value: number | null | undefined) => {
export const formatNumber =
(locale: string) => (value: number | null | undefined) => {
if (isNil(value)) {
return 'N/A';
}
@@ -19,7 +17,9 @@ export function useNumber() {
maximumSignificantDigits: 20,
}).format(value);
};
const short = (value: number | null | undefined) => {
export const shortNumber =
(locale: string) => (value: number | null | undefined) => {
if (isNil(value)) {
return 'N/A';
}
@@ -28,6 +28,10 @@ export function useNumber() {
}).format(value);
};
export function useNumber() {
const locale = 'en-gb';
const format = formatNumber(locale);
const short = shortNumber(locale);
return {
format,
short,