diff options
author | iximeow <me@iximeow.net> | 2022-01-01 13:20:03 -0800 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2022-01-01 13:20:03 -0800 |
commit | 22cbf99292d009c89a6e13c91f901c838a81180d (patch) | |
tree | 55038fa961c4042daf6fa1dbcf6a75193debc9ba | |
parent | 3b834ed7b77cadb09e2f37fd6234f24925b875b8 (diff) |
fix float formatter
integer floats need a .0, the rest get default precision
-rw-r--r-- | src/armv8/a64.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/armv8/a64.rs b/src/armv8/a64.rs index c0d61e6..5ea7f8e 100644 --- a/src/armv8/a64.rs +++ b/src/armv8/a64.rs @@ -2865,7 +2865,11 @@ impl Display for Operand { write!(fmt, "#{:#x}", *i) }, Operand::ImmediateDouble(d) => { - write!(fmt, "#{:0.1}", d) + if *d as i64 as f64 == *d { + write!(fmt, "#{:0.1}", d) + } else { + write!(fmt, "#{:0.}", d) + } }, Operand::Imm16(i) => { write!(fmt, "#{:#x}", *i) |