diff --git a/base/src/test/test_mround_trunc_int b/base/src/test/test_mround_trunc_int new file mode 100644 index 0000000..c8ad72e --- /dev/null +++ b/base/src/test/test_mround_trunc_int @@ -0,0 +1,40 @@ +#![allow(clippy::unwrap_used)] + +use crate::test::util::new_empty_model; + +#[test] +fn arguments() { + let mut model = new_empty_model(); + model._set("A1", "=MROUND()"); + model._set("A2", "=MROUND(10)"); + model._set("A3", "=MROUND(10, 3)"); + model._set("A4", "=MROUND(10, 3, 1)"); + + model._set("A5", "=TRUNC()"); + model._set("A6", "=TRUNC(10)"); + model._set("A7", "=TRUNC(10.22, 1)"); + model._set("A8", "=TRUNC(10, 3, 1)"); + + model._set("A9", "=INT()"); + model._set("A10", "=INT(10.22)"); + model._set("A11", "=INT(10.22, 1)"); + model._set("A12", "=INT(10.22, 1, 2)"); + + + model.evaluate(); + + assert_eq!(model._get_text("A1"), *"#ERROR!"); + assert_eq!(model._get_text("A2"), *"#ERROR!"); + assert_eq!(model._get_text("A3"), *"9"); + assert_eq!(model._get_text("A4"), *"#ERROR!"); + + assert_eq!(model._get_text("A5"), *"#ERROR!"); + assert_eq!(model._get_text("A6"), *"#ERROR!"); + assert_eq!(model._get_text("A7"), *"10.2"); + assert_eq!(model._get_text("A8"), *"#ERROR!"); + + assert_eq!(model._get_text("A9"), *"#ERROR!"); + assert_eq!(model._get_text("A10"), *"10"); + assert_eq!(model._get_text("A11"), *"#ERROR!"); + assert_eq!(model._get_text("A12"), *"#ERROR!"); +} diff --git a/docs/src/functions/math-and-trigonometry.md b/docs/src/functions/math-and-trigonometry.md index 9138a9a..8b62a60 100644 --- a/docs/src/functions/math-and-trigonometry.md +++ b/docs/src/functions/math-and-trigonometry.md @@ -45,7 +45,7 @@ You can track the progress in this [GitHub issue](https://github.com/ironcalc/Ir | FLOOR.MATH | | – | | FLOOR.PRECISE | | – | | GCD | | – | -| INT | | – | +| INT | | – | | ISO.CEILING | | – | | LCM | | – | | LET | | – | @@ -56,7 +56,7 @@ You can track the progress in this [GitHub issue](https://github.com/ironcalc/Ir | MINVERSE | | – | | MMULT | | – | | MOD | | [MOD](math_and_trigonometry/mod) | -| MROUND | | – | +| MROUND | | – | | MULTINOMIAL | | – | | MUNIT | | – | | ODD | | [ODD](math_and_trigonometry/odd) | @@ -92,4 +92,4 @@ You can track the progress in this [GitHub issue](https://github.com/ironcalc/Ir | SUMXMY2 | | – | | TAN | | [TAN](math_and_trigonometry/tan) | | TANH | | [TANH](math_and_trigonometry/tanh) | -| TRUNC | | – | +| TRUNC | | – | diff --git a/docs/src/functions/math_and_trigonometry/int.md b/docs/src/functions/math_and_trigonometry/int.md index a4e4693..96d14ae 100644 --- a/docs/src/functions/math_and_trigonometry/int.md +++ b/docs/src/functions/math_and_trigonometry/int.md @@ -7,6 +7,5 @@ lang: en-US # INT ::: warning -🚧 This function is not yet available in IronCalc. -[Follow development here](https://github.com/ironcalc/IronCalc/labels/Functions) +🚧 This function is implemented but currently lacks detailed documentation. For guidance, you may refer to the equivalent functionality in [Microsoft Excel documentation](https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb). ::: \ No newline at end of file diff --git a/docs/src/functions/math_and_trigonometry/mround.md b/docs/src/functions/math_and_trigonometry/mround.md index ca02f76..01f21ef 100644 --- a/docs/src/functions/math_and_trigonometry/mround.md +++ b/docs/src/functions/math_and_trigonometry/mround.md @@ -7,6 +7,5 @@ lang: en-US # MROUND ::: warning -🚧 This function is not yet available in IronCalc. -[Follow development here](https://github.com/ironcalc/IronCalc/labels/Functions) +🚧 This function is implemented but currently lacks detailed documentation. For guidance, you may refer to the equivalent functionality in [Microsoft Excel documentation](https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb). ::: \ No newline at end of file diff --git a/docs/src/functions/math_and_trigonometry/trunc.md b/docs/src/functions/math_and_trigonometry/trunc.md index 3fc174e..850cd16 100644 --- a/docs/src/functions/math_and_trigonometry/trunc.md +++ b/docs/src/functions/math_and_trigonometry/trunc.md @@ -7,6 +7,5 @@ lang: en-US # TRUNC ::: warning -🚧 This function is not yet available in IronCalc. -[Follow development here](https://github.com/ironcalc/IronCalc/labels/Functions) +🚧 This function is implemented but currently lacks detailed documentation. For guidance, you may refer to the equivalent functionality in [Microsoft Excel documentation](https://support.microsoft.com/en-us/office/excel-functions-by-category-5f91f4e9-7b42-46d2-9bd1-63f26a86c0eb). ::: \ No newline at end of file diff --git a/xlsx/tests/calc_tests/MROUND_TRUNC_INT.xlsx b/xlsx/tests/calc_tests/MROUND_TRUNC_INT.xlsx new file mode 100644 index 0000000..b67610f Binary files /dev/null and b/xlsx/tests/calc_tests/MROUND_TRUNC_INT.xlsx differ