Files
vue-flow/packages/pathfinding-edge/src/edge/utils.ts
T
2023-03-31 21:30:23 +02:00

12 lines
298 B
TypeScript

export function round(x: number, multiple = 10) {
return Math.round(x / multiple) * multiple
}
export function roundDown(x: number, multiple = 10) {
return Math.floor(x / multiple) * multiple
}
export function roundUp(x: number, multiple = 10) {
return Math.ceil(x / multiple) * multiple
}