Zero as a function parameter
Posted: Sun Jan 29, 2023 2:53 am
I have the following function
And test this with
Which works fine. If I make the second parameter 0 (zero) I get a "Not enough parameters" in the NPrint which I presume is coming from the Round2 function.
What have I missed?? Thanks
Code: Select all
/*rounds a number n, (up/down) Or To a number of places d */
Function Round2(n,d)
If d<>0
Return( Floor((n*(10^d)+0.5))/(10^d))
Else
Return Floor(n+0.5)
EndIf
EndFunction
Code: Select all
NPrint (Round2(3.157,1))
WaitLeftMouse
End
What have I missed?? Thanks