Skip to content

Commit a190d29

Browse files
committed
CSSTUDIO-3605 Always use the type "long" when converting to hexadecimal notation.
1 parent d73dad4 commit a190d29

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

core/ui/src/main/java/org/phoebus/ui/vtype/FormatOptionHandler.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,9 @@ private static String formatNumber(final Number value, final Display display,
219219
if (option == FormatOption.HEX)
220220
{
221221
final StringBuilder buf = new StringBuilder();
222-
if (precision <= 8)
223-
buf.append(Integer.toHexString(value.intValue()).toUpperCase());
224-
else
225-
buf.append(Long.toHexString(value.longValue()).toUpperCase());
222+
long longValue = value.longValue();
223+
String hexString = Long.toHexString(longValue);
224+
buf.append(hexString.toUpperCase());
226225
for (int i=buf.length(); i<precision; ++i)
227226
buf.insert(0, '0');
228227
buf.insert(0, "0x");

0 commit comments

Comments
 (0)