Misinformation in documentation for the Formula node

We are using Visual Scripting package 1.7.6 with Unity 2021.3.1f1.

According to the 1.7 documentation for Formula, it says Round “rounds a value to the nearest integer or specified number of decimal places,” and provides an example of “round(3.222, 2)”.

https://docs.unity3d.com/Packages/com.unity.visualscripting@1.7/manual/vs-formula.html

However, attempting to use Formula to round 3.222 to 2 decimal places results in this error:

ArgumentException: round() takes at exactly 1 arguments. 2 provided.

If it’s using Mathf.Round (which only takes 1 argument and returns the nearest integer), the Formula documentation should be updated to reflect proper usage.

confirmed to not work as described in the documentation
8517500--1135547--Capture.PNG

The round has never worked. It has been reported by various people over they years, so work around it with multiply/divide.

The new version that Unity is working on should be quite a bit better and have all these bugs fixed, but no one knows when it will be released. :smile:

1 Like

Thank you, I reported the issue. This is actually how the round should be used, with only 1 value and not 2. this will return 1. Note that 0.50 will return 0 as it is using this math function. Unity - Scripting API: Mathf.Round

8536676--1140098--upload_2022-10-24_14-46-24.png

1 Like