ceil method

Decimal ceil({
  1. int scale = 0,
})

Returns the least Decimal value that is no smaller than this Rational.

An optional scale value can be provided as parameter to indicate the digit used as reference for the operation.

var x = Decimal.parse('123.4567');
x.ceil(); // 124
x.ceil(scale: 1); // 123.5
x.ceil(scale: 2); // 123.46
x.ceil(scale: -1); // 130

Implementation

Decimal ceil({int scale = 0}) => _scaleAndApply(scale, (e) => e.ceil());