Quantise a value to resolution

quantise  n (number), step (positive_number)

Round value to the nearest multiple of step resolution.

Introduced in v2.1

Examples

# Example 1

quantise(10, 1)



# 10 is already a multiple of 1, so returns 10



# Example 2

quantise(10, 1.1)



# Returns 9.9 which is 1.1 * 9



# Example 3

quantise(13.3212, 0.1)



# 13.3



# Example 4

quantise(13.3212, 0.2)



# 13.4



# Example 5

quantise(13.3212, 0.3)



# 13.2



# Example 6

quantise(13.3212, 0.5)



# 13.5