mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 16:54:25 +08:00
add cache management page
This commit is contained in:
@@ -2100,6 +2100,31 @@ export function useI18n() {
|
||||
return formatPercent(value, precision, lowPrecisionValue, numberFormatOptions);
|
||||
}
|
||||
|
||||
function getFormattedVolume(value: number, precision?: number, unit?: 'KiB' | 'MiB'): string {
|
||||
const numberFormatOptions = getNumberFormatOptions({});
|
||||
let displayUnit = unit || 'B';
|
||||
|
||||
if (unit === 'KiB') {
|
||||
value = value / 1024.0;
|
||||
} else if (unit === 'MiB') {
|
||||
value = value / 1024.0 / 1024.0;
|
||||
} else {
|
||||
displayUnit = 'B';
|
||||
|
||||
if (value >= 1024.0) {
|
||||
value = value / 1024.0;
|
||||
displayUnit = 'KiB';
|
||||
}
|
||||
|
||||
if (value >= 1024.0) {
|
||||
value = value / 1024.0;
|
||||
displayUnit = 'MiB';
|
||||
}
|
||||
}
|
||||
|
||||
return formatNumber(value, numberFormatOptions, precision) + ' ' + displayUnit;
|
||||
}
|
||||
|
||||
function getFormattedExchangeRateAmount(value: number, numeralSystem?: NumeralSystem): string {
|
||||
const numberFormatOptions = getNumberFormatOptions({ numeralSystem });
|
||||
return formatExchangeRateAmount(value, numberFormatOptions);
|
||||
@@ -2505,6 +2530,7 @@ export function useI18n() {
|
||||
formatNumberToWesternArabicNumerals: (value: number, precision?: number) => getFormattedNumber(value, NumeralSystem.WesternArabicNumerals, precision),
|
||||
formatPercentToLocalizedNumerals: (value: number, precision: number, lowPrecisionValue: string) => getFormattedPercentValue(value, precision, lowPrecisionValue),
|
||||
formatPercentToWesternArabicNumerals: (value: number, precision: number, lowPrecisionValue: string) => getFormattedPercentValue(value, precision, lowPrecisionValue, NumeralSystem.WesternArabicNumerals),
|
||||
formatVolumeToLocalizedNumerals: getFormattedVolume,
|
||||
formatExchangeRateAmountToWesternArabicNumerals: (value: number) => getFormattedExchangeRateAmount(value, NumeralSystem.WesternArabicNumerals),
|
||||
appendDigitGroupingSymbolAndDecimalSeparator: (value: string) => appendDigitGroupingSymbolAndDecimalSeparator(value, getNumberFormatOptions({})),
|
||||
getAdaptiveAmountRate,
|
||||
|
||||
Reference in New Issue
Block a user