toDoubleStringAsPrecised method

String toDoubleStringAsPrecised({
  1. int length = 4,
})

Use this extension method to get precised values after decimal with defined length.

Implementation

String toDoubleStringAsPrecised({int length = 4}) {
  return ((this * math.pow(10, length)).truncateToDouble() /
          math.pow(10, length))
      .toString();
}