roundTo function

String roundTo(
  1. double value,
  2. int decimalPoints
)

Implementation

String roundTo(double value, int decimalPoints) {
  final power = pow(10, decimalPoints);
  return ((value * power).round() / power).toString();
}