mirror of
https://github.com/storytold/gridcraft.git
synced 2026-10-30 21:56:53 -06:00
functions: add ECMA.CEILING (CEILING under a second name)
This commit is contained in:
@@ -694,6 +694,16 @@ pub(crate) fn specs() -> Vec<FnSpec> {
|
||||
f!("ROUNDDOWN", 2, 2, MathTrig, S, "ROUNDDOWN(number, num_digits)", "Rounds a number toward zero to a given number of digits.", rounddown),
|
||||
f!("MROUND", 2, 2, MathTrig, S, "MROUND(number, multiple)", "Rounds a number to the nearest multiple.", mround),
|
||||
f!("CEILING", 2, 2, Compatibility, S, "CEILING(number, significance)", "Rounds a number up to a multiple of significance.", ceiling),
|
||||
f!(
|
||||
"ECMA.CEILING",
|
||||
2,
|
||||
2,
|
||||
Compatibility,
|
||||
S,
|
||||
"ECMA.CEILING(number, significance)",
|
||||
"Rounds a number up to a multiple of significance.",
|
||||
ceiling
|
||||
),
|
||||
f!(
|
||||
"CEILING.MATH",
|
||||
1,
|
||||
|
||||
@@ -101,6 +101,11 @@ fn rounding() {
|
||||
close(ev2("CEILING", 1.5, 0.1), 1.5);
|
||||
close(ev2("CEILING", 0.234, 0.01), 0.24);
|
||||
is_err(ev2("CEILING", 2.5, -1.0), Num);
|
||||
// ECMA.CEILING is CEILING under a second name (Excel table from #2776).
|
||||
close(ev2("ECMA.CEILING", 1.5, 1.0), 2.0);
|
||||
close(ev2("ECMA.CEILING", -2.5, -2.0), -4.0);
|
||||
close(ev2("ECMA.CEILING", 2.5, 0.0), 0.0);
|
||||
is_err(ev2("ECMA.CEILING", 1.5, -1.0), Num);
|
||||
close(ev2("FLOOR", 3.7, 2.0), 2.0);
|
||||
close(ev2("FLOOR", -2.5, -2.0), -2.0);
|
||||
close(ev2("FLOOR", -2.5, 2.0), -4.0);
|
||||
|
||||
Reference in New Issue
Block a user