diff options
author | NerdyPepper <[email protected]> | 2019-06-20 09:48:07 +0100 |
---|---|---|
committer | NerdyPepper <[email protected]> | 2019-06-20 10:11:14 +0100 |
commit | 5352cc254c04e0f295c59a7c022cc075e8963119 (patch) | |
tree | 3a64613af226dfdccdd324e3d8bdb61ec34fcff6 | |
parent | 1a06f12da5e701b778009fc5c81db28f092fcede (diff) |
quicc fix
-rw-r--r-- | src/format/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/format/mod.rs b/src/format/mod.rs index 210b0cb..baae301 100644 --- a/src/format/mod.rs +++ b/src/format/mod.rs | |||
@@ -35,7 +35,7 @@ fn radix_fmt(number: f64, obase: usize) -> Result<String, CalcError> { | |||
35 | let table: Vec<char> = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".chars().collect(); | 35 | let table: Vec<char> = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".chars().collect(); |
36 | 36 | ||
37 | // format integral part of float | 37 | // format integral part of float |
38 | let mut integral = number.trunc() as i64; | 38 | let mut integral = number.abs().trunc() as i64; |
39 | let mut obase_int = String::new(); | 39 | let mut obase_int = String::new(); |
40 | while integral >= obase as i64 { | 40 | while integral >= obase as i64 { |
41 | obase_int.push(table[(integral % obase as i64) as usize]); | 41 | obase_int.push(table[(integral % obase as i64) as usize]); |