How to get float value from excel using openpyxl in python?
<p>I'm reading an Excel sheet and printing the data returned from it. But when the data in the cells are float values, the output is printed as Long int. How do I get the float value as is from the Excel sheet using openpyxl (using openpyxl because it has good documentation). I know I could convert using float keyword but this doesn't work if used inside a loop which gives string as output as well.<br>
Here is the sample excel data</p>

<pre><code>      A         B              C              D

1  Device    Manufacturer   LMP Version  No.of Devices
2   DUT       CSR           4.0            1
3   REF1      Broadcom      4.0            3
</code></pre>

<p>code is:</p>

<pre><code>import openpyxl
wb=openpyxl.load_workbook('/home/workspace/python/Book1.xlsx')
s = wb.get_sheet_by_name('Setup')     
for j in s['A1':'D3']:
            for cel in j:
                    print cel.coordinate,cel.value
            print '-------------'
</code></pre>

<p>output is:</p>

<pre><code>A1 Device
B1 Manufacturer
C1 LMP Version
D1 No. of Devices
-------------
A2 DUT
B2 CSR
C2 4
D2 1
-------------
A3 REF1
B3 Broadcom 
C3 4
D3 3
</code></pre>

<p>The LMP version is Long int, how do I get the float value?</p>