From 5352cc254c04e0f295c59a7c022cc075e8963119 Mon Sep 17 00:00:00 2001 From: NerdyPepper Date: Thu, 20 Jun 2019 14:18:07 +0530 Subject: quicc fix --- src/format/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/format') 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 { let table: Vec = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".chars().collect(); // format integral part of float - let mut integral = number.trunc() as i64; + let mut integral = number.abs().trunc() as i64; let mut obase_int = String::new(); while integral >= obase as i64 { obase_int.push(table[(integral % obase as i64) as usize]); -- cgit v1.2.3