title: Please provide me the logic to print the result using PRINTF
body: <p>need an programming logic to print an 4 decimal points</p>
  
  <pre><code>  EX: scalar should be 0 to -5   
    value = 10006 , scalar = -3 then print result = 10.0060 (4 decimals)  
    value = 123   ,scalar = -5  then print result = 0.0012 (4 decimals)**  
    required value/divisor = 10 , value%divisor = 0060 (required logic after decimals )
  </code></pre>
  
  <p>I tried like this: </p>
  
  <pre><code> divisor =  std::pow(10,std::abs(scalar));
  
   **Result = snprintf(X,Y,"%d.%0*d",value/scalar,4,value%scalar);**
  </code></pre>
  
  <p>I'm not allowed to use  float , setprecision() .</p>
  
  <p>It does not necessarily represent the actual value , but we can format that value to print with logic like the original one (by using the logic , add ...subtract...pow etc)</p>
  
  <p>std::int32_t divisor = static_cast(std::pow( 10.0F,  std::abs( Scalar)) );</p>
  
  <p>but int the above result modulus scalar value with 0 are not considering.
        **Please provide me the logic to print the above result with scalar condition</p>