title: sprintf changing the number format
body: <p>I'm having a problem with <code>sprintf()</code>, using it to store a mysql query into a var to use it later.</p>
  
  <p>just to inform, I'm using adodb library for database related operations.</p>
  
  <p>being <code>$value=25.5</code> and <code>$id=5</code> for example, i have something like</p>
  
  <pre><code>$value = number_format($baseValue, 2, ".", "");
  
  $query = sprintf("Insert into table_name (id, value) values (%d, $.02f)", $id, $value);
  $db-&gt;Execute($query);
  </code></pre>
  
  <p>there's a condition before this that decides if there is another $query being made before this one. if that first query doesn't run this one runs ok being the query</p>
  
  <pre><code>Insert into table_name (id, value) values (5, 25.50)
  </code></pre>
  
  <p>but if the first query runs then i get an error on this one because the query turns out as</p>
  
  <pre><code>Insert into table_name (id, value) values (5, 25,50)
  </code></pre>
  
  <p>i tried to print <code>$value</code> just right before the <code>sprintf()</code> and it still has the right format, why on earth is this happening and how do i solve it?</p>
  
  <p><strong>Edit</strong>: $value isn't even used or changed until this moment</p>