isEvenDouble function

bool isEvenDouble(
  1. double a,
  2. int fractionDigits
)

Check if a is an Even number after a truncation.

  • fractionDigits : number of decimal digits

Implementation

bool isEvenDouble(double a, int fractionDigits) {
  var aT = truncate(a, fractionDigits);
  var aTString = aT.toString();
  var last = int.parse(aTString[aTString.length - 1]);
  return last % 2 == 0;
}