feat: add validation to include_definition macro

This commit is contained in:
2024-04-18 15:40:41 +02:00
parent c33e2642e1
commit e7f43020dc
27 changed files with 466 additions and 147 deletions

View File

@@ -0,0 +1,13 @@
export function getBoundingValue(_v: number) {
const v = Math.abs(_v);
let level = 1;
const levels = [1, 2, 4, 10, 20, 50, 100, 200, 300, 400, 500, 1000];
for (const l of levels) {
level = l;
if (l >= v) break;
}
return _v >= 0 ? level : -level;
}