FIX: Fixes ROUND, ROUNDUP and ROUNDDOWN behaviour
This commit is contained in:
committed by
Nicolás Hatcher Andrés
parent
71d6a3d66c
commit
f2cb05d7bf
15
base/src/test/test_fn_round.rs
Normal file
15
base/src/test/test_fn_round.rs
Normal file
@@ -0,0 +1,15 @@
|
||||
#![allow(clippy::unwrap_used)]
|
||||
|
||||
use crate::test::util::new_empty_model;
|
||||
|
||||
#[test]
|
||||
fn fn_round_approximation() {
|
||||
let mut model = new_empty_model();
|
||||
model._set("A1", "=ROUND(1.05*(0.0284+0.0046)-0.0284,4)");
|
||||
model._set("A2", "=ROUNDDOWN(1.05*(0.0284+0.0046)-0.0284,5)");
|
||||
|
||||
model.evaluate();
|
||||
|
||||
assert_eq!(model._get_text("A1"), *"0.0063");
|
||||
assert_eq!(model._get_text("A2"), *"0.00625");
|
||||
}
|
||||
Reference in New Issue
Block a user