hasDecimals property
Returns true if this double has a non-zero fractional part.
Example:
15.5.hasDecimals; // true
15.0.hasDecimals; // false
15.00.hasDecimals; // false
Audited: 2026-06-12 11:26 EDT
Implementation
@useResult
bool get hasDecimals {
if (isNaN || isInfinite) {
return false;
}
return this % 1 != 0;
}