February 25th, 2010, 07:15 AM
Displaying result of a function using haskell
I have to do an assignment using the IO function in haskell which takes 2 float values and 1 boolean value. The boolean value is then used to decide upon a 3rd float value and the 3 float values are then entered into a function which needs to be output to the screen. I have the result as a float.
Right now, im using the GHCi environment and it doesn't want to compile the following line:
giving me the compiler error message shown in the attached picture
print ("The price of your pizza is: " ++ pizzaPrice);
Can anyone give me a fix for this line or even suggest a better way of displaying the result of our function!!
February 25th, 2010, 07:36 AM
Post the rest of the code, please.
February 25th, 2010, 07:37 AM
it doesn't matter now, but if you could still help me, i need to round the result of my function to 2 decimal places....I've tried looking for roundTo but it doesn't seem to want to do it.
Originally Posted by Winters
February 25th, 2010, 08:11 AM