code: def num_to_thaiword(number: int) -> str:
      
      ret = ""
  
      if number is None:
          pass
      elif number == 0:
          ret = "ศูนย์"
      else:
          _POS_CALL = ["แสน", "หมื่น", "พัน", "ร้อย", "สิบ", ""]
          _NUM_CALL = [
              "",
              "หนึ่ง",
              "สอง",
              "สาม",
              "สี่",
              "ห้า",
              "หก",
              "เจ็ด",
              "แปด",
              "เก้า",
          ]
  
          if number > 1000000:
              ret += num_to_thaiword(int(number / 1000000)) + "ล้าน"
              number = int(math.fmod(number, 1000000))
          divider = 100000
  
          pos = 0
          while number > 0:
              d = int(number / divider)
  
              if (divider == 10) and (d == 2):
                  ret += "ยี่"
              elif (divider == 10) and (d == 1):
                  ret += ""
              elif (divider == 1) and (d == 1) and (ret != ""):
                  ret += "เอ็ด"
              else:
                  ret += _NUM_CALL[d]
  
              if d:
                  ret += _POS_CALL[pos]
              else:
                  ret += ""
  
              number = number % divider
              divider = divider / 10
              pos += 1
  
      return ret
docs: :param int number: a float number (with decimals) indicating a quantity
      :return: a text that indicates the full amount in word form, properly ending each digit with the right term.