Processing

PythonでProcessing Math Calculation round()

round()

nパラメータに最も近い整数を計算する。

x = 4.2
rx = round(x)  # Sets 'rx' to 4
y = 4.5
ry = round(y)  # Sets 'ry' to 5
z = 4.9
rz = round(z)  # Sets 'rz' to 5