fixed point decimal printf output
<p>I have my LCD working on my TM4C123 and I have printf working.</p>

<p>I'm trying to make the input from the left column look like the output from the right column.</p>

<p>What I tried was to extract each digit from the integer and then print each one out and then put the decimal somewhere in there.  When I do extract the digits, the sign seems to stick with the digit and I just can't seem to get it formatted right.  </p>

<pre><code>outTestCaseType1 outTests1[13]={ 
{     0,  " =  0.000?\r" }, //     0/1000 = 0.000  
{     4,  " =  0.004?\r" }, //     4/1000 = 0.004  
{    -5,  " = -0.005?\r" }, //    -5/1000 = -0.005
{    78,  " =  0.078?\r" }, //    78/1000 = 0.078
{  -254,  " = -0.254?\r" }, //  -254/1000 = -0.254
{   999,  " =  0.999?\r" }, //   999/1000 = 0.999
{ -1000,  " = -1.000?\r" }, // -1000/1000 = -1.000
{  1234,  " =  1.234?\r" }, //  1234/1000 = 1.234
{ -5678,  " = -5.678?\r" }, // -5678/1000 = -5.678
{ -9999,  " = -9.999?\r" }, // -9999/1000 = -9.999
{  9999,  " =  9.999?\r" }, //  9999/1000 = 9.999
{ 10000,  " =  *.***?\r" }, // error
{-10000,  " =  *.***?\r" }  // error
};
</code></pre>

<p>My code is as follows:</p>

<pre><code>void ST7735_sDecOut3(int32_t n) {
    int32_t msd,nsd, lsd;
    int32_t value;
    value=n;
 if (value &gt; 999)
 {
  value = 999;
 }

 msd = value / 100;
 value -= msd * 100;

 nsd = value / 10;
 value -= nsd * 10;

 lsd = value;

 printf("%d%d%d", msd, nsd, lsd);

}
</code></pre>

<p>The output is as follows on the LCD:</p>

<p><a href="https://i.stack.imgur.com/761vz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/761vz.png" alt="enter image description here"></a></p>

<p>I'm picking at this as much as I can and this is as close as I got so far.  There could be an easier way that I don't see because of my inexperience but I'll keep trying because that's all I can do.</p>

<p>Any hints or help will be appreciated.</p>