FIX: Format numbers a tad better

I still think there is some way to go, but this is closer to Excel
This commit is contained in:
Nicolás Hatcher
2025-11-19 21:50:16 +01:00
committed by Nicolás Hatcher Andrés
parent acb90fbb9d
commit dc49afa2c3
5 changed files with 55 additions and 17 deletions

View File

@@ -8,6 +8,15 @@ fn test_simple_format() {
assert_eq!(formatted.text, "2.3".to_string());
}
#[test]
fn test_maximum_zeros() {
let formatted = format_number(1.0 / 3.0, "#,##0.0000000000000000000", "en");
assert_eq!(formatted.text, "0.3333333333333330000".to_string());
let formatted = format_number(1234.0 + 1.0 / 3.0, "#,##0.0000000000000000000", "en");
assert_eq!(formatted.text, "1,234.3333333333300000000".to_string());
}
#[test]
#[ignore = "not yet implemented"]
fn test_wrong_locale() {