double toPrecision(int fractionDigits) { if (this == null) return 0.0; return double.parse(this!.toStringAsFixed(fractionDigits)); }