Macro serde_json_lodash::x_ceil_x
source · [−]macro_rules! x_ceil_x {
() => { ... };
($a:expr $(,)*) => { ... };
($a:expr, $b:expr $(,)*) => { ... };
($a:expr, $b:expr, $($rest:tt)*) => { ... };
}
Expand description
Based on x_ceil_x()
Examples:
#[macro_use] extern crate serde_json_lodash;
use serde_json::Number;
assert_eq!(
x_ceil_x!(Number::from_f64(4.006).unwrap()),
Number::from(5)
);
assert_eq!(
x_ceil_x!(Number::from_f64(6.004).unwrap(), 2),
Number::from_f64(6.01).unwrap()
);
assert_eq!(
x_ceil_x!(Number::from(6040), -2),
Number::from(6100)
);
More examples:
assert_eq!(
x_ceil_x!(),
Number::from(0)
);