PgDecimal.fromDouble constructor

PgDecimal.fromDouble(
  1. double value
)

O valor decimal mais curto que representa value (o mesmo de value.toString()): PgDecimal.fromDouble(0.1) é 0.1.

Implementation

factory PgDecimal.fromDouble(double value) {
  if (value.isNaN) return nan;
  if (value.isInfinite) return value.isNegative ? negativeInfinity : infinity;
  return PgDecimal.parse(value.toString());
}