Skip to content

Commit 7f7d4dc

Browse files
committed
Tooltip data display: Format floats and doubles better
Floats and doubles will now always be displayed with a decimal point and one digit after it, even if they are whole numbers. Floats will also have the f suffix. This is so you can tell the data type just by glancing at the value.
1 parent d8ead1f commit 7f7d4dc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

objdiff-core/src/arch/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ impl DataType {
9595
}
9696
}
9797
DataType::Float => {
98-
format!("Float: {}", Endian::read_f32(bytes))
98+
format!("Float: {:?}f", Endian::read_f32(bytes))
9999
}
100100
DataType::Double => {
101-
format!("Double: {}", Endian::read_f64(bytes))
101+
format!("Double: {:?}", Endian::read_f64(bytes))
102102
}
103103
DataType::Bytes => {
104104
format!("Bytes: {:#?}", bytes)

0 commit comments

Comments
 (0)