From 047c900193b12bcefc00379dc66be2597941a85d Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 1 Apr 2023 16:43:26 -0700 Subject: [PATCH] Fixed missing sign print --- src/quantity/quantity.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/quantity/quantity.rs b/src/quantity/quantity.rs index 80d3578..31052f3 100644 --- a/src/quantity/quantity.rs +++ b/src/quantity/quantity.rs @@ -61,18 +61,18 @@ impl ToString for Quantity{ } else { if exp <= 0 { // Decimal, needs `0.` and leading zeros format!( - "0.{}{string}", + "{sign}0.{}{string}", "0".repeat(exp_u) ) } else if exp_u < string.len() { // Decimal, needs only `.` format!( - "{}.{}", + "{sign}{}.{}", &string[0..exp_u], &string[exp_u..] ) } else { // Integer, needs trailing zeros format!( - "{string}{}", + "{sign}{string}{}", "0".repeat(exp_u - string.len()) ) }