title: How to Convert the last digit of a number to a char and display it on LCD?
body: <p>I recently got a STM8 MCU and it has the built in function <code>LCD_GLASS_DisplayString(&quot;STRING&quot;)</code></p>
  <p>The problem with that function is, as you can see below, that I cannot directly display an integer on it:</p>
  <pre><code>void LCD_GLASS_DisplayString(uint8_t* ptr)
  {
    uint8_t i = 0x01;
  
      LCD_GLASS_Clear();
    /* Send the string character by character on lCD */
    while ((*ptr != 0) &amp; (i &lt; 8))
    {
      /* Display one character on LCD */
      LCD_GLASS_WriteChar(ptr, FALSE, FALSE, i);
  
      /* Point on the next character */
      ptr++;
  
      /* Increment the character counter */
      i++;
    }
  }
  </code></pre>
  <p>How could I modify it so I could send integers directly? Also, I'm not sure I can use any libraries, so just pure C would help.</p>
  <p>I was thinking of something like this, but it didn't work:</p>
  <pre><code>void LCD_GLASS_DisplayINT(uint16_t integer)
  {
    uint8_t i = 0x01;
  
      LCD_GLASS_Clear();
    /* Send the string character by character on lCD */
    while ((integer != 0) &amp; (i &lt; 8))
    {
      /* Display one number on LCD */
      LCD_GLASS_WriteChar(&quot;0&quot; + integer%10, FALSE, FALSE, i);
  
      /* Point on the next number*/
      integer=integer/10;
  
      /* Increment the character counter */
      i++;
    }
  }
  </code></pre>
  <p>Any idea on how to make it work? I need to either make a function to display the integers or a way to convert them to strings before I send them over to the LCD. The code is pure C, as what I'm programming are pure drivers right now.</p>