DoubleExtensions extension

Extensions for double operations and utilities.

on

Properties

absValue double

Available on double, provided by the DoubleExtensions extension

Returns the absolute value of the number.
no setter

Methods

clampTo(double min, double max) double

Available on double, provided by the DoubleExtensions extension

Clamps the number between min and max.
formatAsString(int decimals) String

Available on double, provided by the DoubleExtensions extension

Formats the number as a string with specified decimal places.
isApproximatelyEqual(double other, {double epsilon = 0.0001}) bool

Available on double, provided by the DoubleExtensions extension

Checks if the number is approximately equal to other within epsilon.
isBetween(double min, double max) bool

Available on double, provided by the DoubleExtensions extension

Returns true if the number is between min and max (inclusive).
roundTo(int decimals) double

Available on double, provided by the DoubleExtensions extension

Rounds the number to the specified number of decimal places.
toFileSize({int decimals = 1}) String

Available on double, provided by the DoubleExtensions extension

Converts the number to a human-readable file size string.
toPercentage({int decimals = 0}) String

Available on double, provided by the DoubleExtensions extension

Converts the number to a percentage string.