round a double to with a precision of given n digit
n
double roundToPrecision(int n) { final f = pow(10, n); return (this * f).round() / f; }