mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
14 lines
314 B
Dart
14 lines
314 B
Dart
import 'dart:math';
|
|
|
|
extension RangeNum on num {
|
|
bool isInRange(num index, num range) {
|
|
return index - range < this && this < index + range;
|
|
}
|
|
}
|
|
|
|
extension DoubleExtension on double {
|
|
double roundTo(int places) {
|
|
num mod = pow(10.0, places);
|
|
return ((this * mod).round().toDouble() / mod);
|
|
}
|
|
}
|