floorTo

fun Double.floorTo(decimals: Int): Double

Returns this value rounded down (toward negative infinity) at decimals fractional digits.

For example 3.75.floorTo(1) is 3.7 and (-3.11).floorTo(1) is -3.2. Throws IllegalArgumentException when decimals is outside 0..15. NaN, infinities, and magnitudes at or above 2^52 are returned unchanged. The result is the nearest representable Double to the exact decimal.