# Quantize a real-valued function?

I'm wondering if there's a built-in way in Mathematica to take a function whose output values are continuous, and quantize it to produce a step function. For example, I have the function

f[x_, n_, h_] := ArcTan[(n x)/h]*180/Pi - ArcTan[((n - 1) x)/h]*180/Pi


which I would like to digitize so that it takes on values in the set {0, 5, ... , 25}. I've done some searching but can't find a good way to achieve this.

Yes, you can use Round. The second argument of Round is the quantization step.

Examples:

Plot[
Round[Sin[x], 0.2],
{x, 0, 2 Pi}
]


Plot[
Round[Sin[x], 0.2],
{x, 0, 2 Pi},
ExclusionsStyle -> Automatic
]