decimal property
Decimal?
decimal
Attempts to convert the number to a Decimal
.
Example:
print(123.456.decimal); // Output: 123.456 (as a Decimal)
print('abc'.decimal); // Output: null
Implementation
Decimal? get decimal => Decimal.tryParse(toString());