
-----------------------------------
ovechking899
Mon Dec 21, 2015 1:02 pm

Help with round function
-----------------------------------
What is it you are trying to achieve?
I want to round a number to 2 decimals

What is the problem you are having?
when i use the round function it gives error "Expression is not a procedure and hence cannot be called"



money2 := money2 * 100
round (money2)
money2 := money2 / 100



Please specify what version of Turing you are using
4.1.1

-----------------------------------
Tony
Mon Dec 21, 2015 4:16 pm

RE:Help with round function
-----------------------------------
round is a function that returns a value, and not a procedure (that might or might not be modifying a value).

-----------------------------------
lordroba
Wed Dec 23, 2015 1:22 am

Re: Help with round function
-----------------------------------
Here's an example on how to use the function



var money : real
var money2 : int
money := 10.55
money2 := round (money)
put money2


