Appending Zeros to a number

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Appending Zeros to a number

  • Creator
    Topic
  • #50646
    Gena Gill
    Participant

      I need to append zeros to the front of a Dr. number, when that number is less than 5 digits.

      I have some code that I use to strip zeros in my translation (see below)

      set inp [lindex $xlateInVals 0]

      set xlateOutVals [string trimleft $inp 0]

      But, I need some that will add zeros until the total number of digits in the number equal 5.  Does anyone have anything that they can share?

      Thanks

    Viewing 1 reply thread
    • Author
      Replies
      • #66956

        Here’s how I do it:

        Code:

        set tmp [format “%05s” [lindex $xlateInVals 0]]; set xlateOutVals [list $tmp]

        -- Max Drown (Infor)

      • #66957
        Gena Gill
        Participant

          Whoo Hoo!  You’re my hero!

          Now I won’t have to build and maintain a table of physician numbers.

      Viewing 1 reply thread
      • The forum ‘Cloverleaf’ is closed to new topics and replies.