From eb8df0ae2a2177c75a0e1874aa67b8b3b7af2664 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Sat, 1 Jan 2022 16:16:05 +0100 Subject: [PATCH] Calculator: Display zero with only one character This patch prevents zero to be displayed as "0.00". The value is now always printed with only one character. --- Userland/Applications/Calculator/KeypadValue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Applications/Calculator/KeypadValue.cpp b/Userland/Applications/Calculator/KeypadValue.cpp index 6737d7999f..a60b68f083 100644 --- a/Userland/Applications/Calculator/KeypadValue.cpp +++ b/Userland/Applications/Calculator/KeypadValue.cpp @@ -10,7 +10,7 @@ KeypadValue::KeypadValue(i64 value, u8 decimal_places) : m_value(value) - , m_decimal_places(decimal_places) + , m_decimal_places(value == 0 ? 0 : decimal_places) { }