− let amount_num =
− record
− .belopp
− .replace(" kr", "")
− .replace(",", ".")
− //.replace("-", "")
− .chars()
− .filter(|c| c.is_ascii())
− .filter(|c| !c.is_whitespace())
− .collect::<String>()
− .parse::<f32>()
− .unwrap();
− //if account_name == "Tillgångar:Likvida Medel:Brukskonto" {
− //amount_num = -amount_num;
− //}
+ let amount_num = record
+ .belopp
+ .replace(" kr", "")
+ .replace(",", ".")
+ //.replace("-", "")
+ .chars()
+ .filter(|c| c.is_ascii())
+ .filter(|c| !c.is_whitespace())
+ .collect::<String>()
+ .parse::<f32>()
+ .unwrap();
+
+ let amount_balance = match record.saldo {
+ Some(saldo) => Some(
+ saldo
+ .replace(" kr", "")
+ .replace(",", ".")
+ .chars()
+ .filter(|c| c.is_ascii())
+ .filter(|c| !c.is_whitespace())
+ .collect::<String>()
+ .parse::<f32>()
+ .unwrap(),
+ ),
+ None => None,
+ };