NumMoreExtensions extension
Number More: clamp non-negative, isInteger, round half up, truncate decimals, percentage, degrees/radians, etc. Roadmap #311-325.
- on
Properties
- isInteger → bool
-
Available on num, provided by the NumMoreExtensions extension
Returnstrueif this number has no fractional part.no setter
Methods
-
clampNonNegative(
) → int -
Available on num, provided by the NumMoreExtensions extension
Returns this number rounded to the nearest int, with negatives clamped to0. -
percentageChangeFrom(
num from) → double -
Available on num, provided by the NumMoreExtensions extension
Returns the fractional change fromfromto this value. -
percentageOf(
num total) → double -
Available on num, provided by the NumMoreExtensions extension
Returns this value as a fraction oftotal. -
truncateToDecimals(
int places) → double -
Available on num, provided by the NumMoreExtensions extension
Truncates this number toplacesdecimal places without rounding.