roundto

(function for equations)

 

Usage:

roundto (dx, x)

Definition:

dx * floor ((x + dx/2) / dx)

Required:

dx > 0

Rounds x to the nearest dx, which may be less than or greater than 1.

For example, roundto(10,17) rounds 17 to the nearest 10, and so it returns 20.

If dx = 1, then this is the same as round.