diff options
author | bd <bdunahu@operationnull.com> | 2025-04-26 14:29:48 -0400 |
---|---|---|
committer | bd <bdunahu@operationnull.com> | 2025-04-26 14:29:48 -0400 |
commit | 1c174cc103cb1b00befed6e52b40bb3e76cc7797 (patch) | |
tree | e330ba0b693b6aad6d361883b6e35986ee48971d /gui/digitlabelhelper.h | |
parent | 94c0d7b5045244f20dfa13f7d31e0e06901908c2 (diff) |
Use two's complement in number display
Diffstat (limited to 'gui/digitlabelhelper.h')
-rw-r--r-- | gui/digitlabelhelper.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gui/digitlabelhelper.h b/gui/digitlabelhelper.h index a0f845f..715089a 100644 --- a/gui/digitlabelhelper.h +++ b/gui/digitlabelhelper.h @@ -24,7 +24,8 @@ class DigitLabelHelper { public: /** - * Contains the main formatting logic used to format integers. + * Contains the main formatting logic used to format integers. Uses 2's + * complement for hexadecimal numbers. * @param the value to be formated * @param if the value should be displayed in hex. If false, displays in * decimal. @@ -35,7 +36,7 @@ class DigitLabelHelper { if (is_cleared) return QString(); - return is_hex ? QString::number(value, 16).toUpper() + return is_hex ? QString::asprintf("%04X", value) : QString::number(value); } }; |