Tidy up amount calculation
This commit is contained in:
+1
-3
@@ -18,9 +18,7 @@ fn parse_amount_str(amount_str: &str) -> Result<i64, Error> {
|
||||
let frac = format!("{:0<2}", frac);
|
||||
let frac = frac.parse::<i64>()?;
|
||||
|
||||
let mut amount: i64 = 0;
|
||||
amount += whole * 100 * 10;
|
||||
amount += frac * 10;
|
||||
let amount = whole * 100 * 10 + frac * 10;
|
||||
Ok(if negative { -amount } else { amount })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user