more fixes

This commit is contained in:
shenlong-tanwen
2025-12-04 02:09:52 +05:30
parent b06f591b7a
commit a2a5b7e758
9 changed files with 91 additions and 48 deletions

View File

@@ -0,0 +1,8 @@
import 'dart:math' as math;
extension DoubleTruncate on double {
double truncateTo(int fractionDigits) {
final mod = math.pow(10.0, fractionDigits);
return ((this * mod).truncate() / mod);
}
}