roundToInt method

int roundToInt({
  1. NumberRoundType roundType = NumberRoundType.round,
})

Converts number to int.

Just wrap the round, floor and ceil methods.

Implementation

int roundToInt({NumberRoundType roundType = NumberRoundType.round}) {
  switch (roundType) {
    case NumberRoundType.round:
      return round();
    case NumberRoundType.floor:
      return floor();
    case NumberRoundType.ceil:
      return ceil();
    default:
      throw Exception('Unknown round type: $roundType');
  }
}