truncateToDecimals method
Truncates this number to places decimal places without rounding.
Digits beyond places are dropped toward zero.
Example:
3.14159.truncateToDecimals(2); // 3.14
Implementation
@useResult
double truncateToDecimals(int places) {
final double f = math.pow(10, places).toDouble();
return (this * f).truncate() / f;
}