FIX[Format-parser]: Parse [$€]#,##0.00 correctly

We will need to have a look at the format parser sooner rather
than later though
This commit is contained in:
Nicolás Hatcher
2024-12-09 19:39:23 +01:00
parent 2f2a5e4fba
commit 4ef8a6882f
5 changed files with 28 additions and 0 deletions

View File

@@ -245,6 +245,9 @@ pub fn format_number(value_original: f64, format: &str, locale: &Locale) -> Form
}
ParsePart::Number(p) => {
let mut text = "".to_string();
if let Some(c) = p.currency {
text = format!("{}", c);
}
let tokens = &p.tokens;
value = value * 100.0_f64.powi(p.percent) / (1000.0_f64.powi(p.comma));
// p.precision is the number of significant digits _after_ the decimal point