fix: display numbers always with dot

This commit is contained in:
ShareVB 2024-09-11 23:30:37 +02:00
parent 0de61ef555
commit 66dd351d48
3 changed files with 10 additions and 10 deletions

View file

@ -6,9 +6,7 @@ export type AllSupportedUnits = BibytesUnits | BytesUnits | BitsUnits;
export function displayStorageAndRateUnits(
{ value, unit, precision = 3, appendUnit = false }:
{ value: number; unit: AllSupportedUnits; precision?: number ; appendUnit?: boolean }): string {
return value.toLocaleString(undefined, {
maximumFractionDigits: precision,
}) + (appendUnit ? unit : '');
return value.toFixed(precision).replace(/0+$/, '').replace(/\.$/, '') + (appendUnit ? unit : ''); // NOSONAR
}
export function convertStorageAndRateUnitsDisplay(