Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Set decimal places

    Scheduled Pinned Locked Moved
    Gcode meta commands
    2
    3
    120
    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.
    • handyandyundefined
      handyandy
      last edited by

      Hi,
      I would like to echo the value of 'heat.heaters[1].current' in the following line of code as an integer (i.e. no decimal places). Currently it always displays it with to two decimal places.

      echo "Heating the nozzle to " ^ global.filamentTemp ^ ", it's currently " ^ heat.heaters[1].current ^ "°C"

      It must be easy but I'm feeling a bit thick today!

      dc42undefined 1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @handyandy
        last edited by

        @handyandy see the floor function at https://docs.duet3d.com/User_manual/Reference/Gcode_meta_commands#functions.

        Duet WiFi hardware designer and firmware engineer
        Please do not ask me for Duet support via PM or email, use the forum
        http://www.escher3d.com, https://miscsolutions.wordpress.com

        1 Reply Last reply Reply Quote 0
        • handyandyundefined
          handyandy
          last edited by

          Thanks for that.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Unless otherwise noted, all forum content is licensed under CC-BY-SA