From bef2100bb78c851067f65731532695f74b302ae9 Mon Sep 17 00:00:00 2001 From: "Tobias Burdow [Kaleidox]" Date: Wed, 13 Dec 2023 15:50:35 +0100 Subject: [PATCH] fix https://github.com/comroid-git/clmath/issues/14 --- common/Units.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/Units.cs b/common/Units.cs index 91d515b..88e4194 100644 --- a/common/Units.cs +++ b/common/Units.cs @@ -498,7 +498,9 @@ public override string Name strip |= SiPrefix.One; if (!@base.Identifier.Contains(strip.Identifier)) return null; - return Units.ParseUnit(@base.Identifier.Replace(strip.Identifier, string.Empty)) * value; + return Units.ParseUnit(strip.Identifier.Length == 0 + ? @base.Identifier + : @base.Identifier.Replace(strip.Identifier, string.Empty)) * value; } }