From 49e03d419bb3e4e41437f5587e9bcb1ac513f237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20Zu=CC=81brik?= Date: Fri, 30 Aug 2024 13:04:44 +0200 Subject: [PATCH] Issue 67 - exponential value too soon 1e5 is way too soon when converting meters to millimeters --- projects/ng-units/src/lib/formatters.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/projects/ng-units/src/lib/formatters.ts b/projects/ng-units/src/lib/formatters.ts index 33ffb41..3c02908 100644 --- a/projects/ng-units/src/lib/formatters.ts +++ b/projects/ng-units/src/lib/formatters.ts @@ -5,7 +5,7 @@ export const QuantityFormatters: { [name: string]: QuantityFormatter } = { 'default': function (value: number): string { const abs = Math.abs(value); let text: string; - if (abs && (abs >= 1e5 || abs <= 1e-2)) { + if (abs && (abs >= 1e10 || abs <= 1e-2)) { text = removeZeroDigits(value.toExponential(3)); } else {