Need a way to round up
-
x=(25/8).ceil #returns 3 y=(25/8).round # returns 3These are the only functions I can find. I need x/8 to roundup to the next whole number.
Thanks for looking
-
@davesexcel said:
x=(25/8).ceil #returns 3 y=(25/8).round # returns 3These are the only functions I can find. I need x/8 to roundup to the next whole number.
Thanks for looking
y=(25/8.0).ceil# returns 4
Learn the difference between using an Integer and a Float
25/8 >>> 3 - which rounds up to 3
but
25/8.0 >>> 3.125 - which rounds UP to 4, as it is NOT 3 ! -
Right on, thanks, forgot about that.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement