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 * pow(10, length)).truncateToDouble() / pow(10, length))
      .toString();
}