I have a float 1.23
for instance, if I use round
, it returns 1
. My desired output is 2
, which is round to the next integer. I can write a function to do it. I just wonder is there any already written function to do it (like round
). Thanks.
You can use the ceiling
function (in Prelude
):
ghci>> ceiling 1.23
2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With