sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🛣️ Road Profile Builder | Generate roads, curbs and pavements easily Download

    Need a way to round up

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 299 Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      davesexcel
      last edited by

      x=(25/8).ceil #returns 3 y=(25/8).round # returns 3

      These are the only functions I can find. I need x/8 to roundup to the next whole number.

      Thanks for looking

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        @davesexcel said:

        x=(25/8).ceil #returns 3 y=(25/8).round # returns 3

        These 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 !

        TIG

        1 Reply Last reply Reply Quote 0
        • D Offline
          davesexcel
          last edited by

          Right on, thanks, forgot about that.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement