From 1a2ae455c93142a2eae5ef77cda0cd89353ce1e7 Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Fri, 12 Jul 2024 22:46:28 +0200 Subject: [PATCH] fix: Add Hexadecimal as default NumberBase Signed-off-by: Myzel394 <50424412+Myzel394@users.noreply.github.com> --- .../numberhub/data/model/converter/unit/BasicUnit.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/data/model/src/main/java/app/myzel394/numberhub/data/model/converter/unit/BasicUnit.kt b/data/model/src/main/java/app/myzel394/numberhub/data/model/converter/unit/BasicUnit.kt index 1b697d5f..14298017 100644 --- a/data/model/src/main/java/app/myzel394/numberhub/data/model/converter/unit/BasicUnit.kt +++ b/data/model/src/main/java/app/myzel394/numberhub/data/model/converter/unit/BasicUnit.kt @@ -37,6 +37,16 @@ sealed interface BasicUnit { interface NumberBase : BasicUnit { fun convert(unitTo: NumberBase, value: String): String + + companion object { + val Hexadecimal = NumberBaseUnit( + "hexadecimal", + BigDecimal(16), + UnitGroup.NUMBER_BASE, + 0, + 0, + ) + } } interface Default : BasicUnit {