title: SSIS data conversion issue of decimal
body: <p>I have a dtsx package running in SSIS on our SQL server (2016 SP2 CU6), its a lightweight task of importing an Excel (xlsx) worksheet into a table in SQL as-is, no transformations needed at this stage, there is an agent job that does a lot more around it but I can see the fault is occurring in just this section.</p>
  
  <p>The issue I am seeing is that a number in Excel (<code>0.0153</code>) comes out in SQL as if converted badly (<code>1.5299999999999999E-2</code>).</p>
  
  <p>To confirm the number in Excel is <code>0.0153</code> and not something longer or formatted to look like this.</p>
  
  <p><a href="https://i.stack.imgur.com/ex5jw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ex5jw.png" alt="Both values are just 6 characters in length, formula bar shows actual value"></a></p>
  
  <p>After the import this is what I have: -</p>
  
  <p><a href="https://i.stack.imgur.com/nPmqT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nPmqT.png" alt="Both values show in SQL"></a></p>
  
  <p>I find this odd as: - </p>
  
  <ul>
  <li>They are both in a very similar situation but with different outcomes</li>
  <li>They are one after the other in the Excel worksheet</li>
  <li>They are near the top of the worksheet (rows 10 and 11) so sampling should be using them to understand the data type if there is anything like that happening (row 1 is <code>0.193841</code> which is also similar, overall range is -29 to 200 with up to 7 decimal places) </li>
  <li>There is only 0.0021 difference between them</li>
  </ul>
  
  <p>The number format in Excel is <code>General</code> and the column in SQL is <code>NVARCHAR(255)</code></p>
  
  <p>In the SSIS package the Excel source DataType for the <em>External Column</em> is being classed as <code>double-precision float [DT-R8]</code> (not sure where that comes from but I have no ability to change it) and the <em>Output Column</em> is <code>Unicode string [DT-WSTR]</code></p>
  
  <p>I am then using <code>Native OLE DB\SQL Server Native Client 11.0</code> OLD DB Connection to get to the table.</p>
  
  <p>Its a simple package but why is this value jumping so wildly. Its not a one off, the input has around 1700 rows and we see this on a number of rows.</p>
  
  <p><a href="https://i.stack.imgur.com/R5KQ7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/R5KQ7.png" alt="Package layout"></a></p>