vectorA:round
From ComputerCraft Wiki
Function vector:round | |
Rounds the vector coordinates to the nearest integers and returns the result as a new vector. | |
Syntax | vector:round() |
Returns | vector |
Part of | ComputerCraft |
API | vector |
Examples
Example | |
Rounds a vector and prints the resulting coordinates. | |
Code |
local a = vector.new(1.4999, 1.5, 3.14) local c = a:round() print(c.x) print(c.y) print(c.z) --1 --2 --3 |