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:
committed by
Nicolás Hatcher Andrés
parent
acb90fbb9d
commit
dc49afa2c3
@@ -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() {
|
||||
|
||||
@@ -96,3 +96,14 @@ fn test_fn_tan_pi2() {
|
||||
// This is consistent with IEEE 754 but inconsistent with Excel
|
||||
assert_eq!(model._get_text("A1"), *"1.63312E+16");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_trigonometric_identity() {
|
||||
let mut model = new_empty_model();
|
||||
model._set("A1", "=COTH(1)*CSCH(1)");
|
||||
model._set("A2", "=COSH(1)/(SINH(1))^2");
|
||||
model._set("A3", "=A1=A2");
|
||||
model.evaluate();
|
||||
|
||||
assert_eq!(model._get_text("A3"), *"TRUE");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user