0

The following fake excel file:

<style> .text { mso-number-format:\@; }</style>
<div>
    <table class="results" cellspacing="0" rules="all" border="1" id="ctl00_content_grdData" style="border-collapse:collapse;">
        <thead>
            <tr>
                <th scope="col">A</th><th scope="col">B</th><th scope="col">C</th><th scope="col">D</th>
            </tr>
        </thead><tbody>
            <tr>
                <td class="text">1000</td><td>1000.00</td><td>1000,00</td><td>1.000,00</td>
            </tr>
        </tbody>
    </table>
</div>

Is displayed in Excel 2007 as
excel_1000

Notice that column B is displayed like "1000.00.00".

Additional information: The regional / language settings from Windows are set to 'Italy'.

How is this possible, and how to solve this ?

Note : I used different values, just to show the different behaviour from Excel.

Edit 2
When I put the value '1000.00' in column A (the column which has the class 'text' on the td-element, the value is displayed exactly as it should in Excel:
enter image description here

3
  • What do you mean with 1000.00, then? With Italian locale, it should be 1000,00
    – stivlo
    Jun 21, 2011 at 13:08
  • are you trying to fix this in Excel or html? If in html, is that image from the page?
    – alquatoun
    Jun 21, 2011 at 13:08
  • @Stivlo, probably the '1000.00' is not recognized as a number, so I would expect that it's just displayed as '1000.00' Jun 21, 2011 at 13:10

2 Answers 2

2

According to the Italian locale, 1000.00 is displayed as 1000.00.00 because is recognized as time (like a period of time). So the first number is the hours, then the minutes, then the seconds.

In OpenOffice, but should be the same in Excel, I checked the time format with Italian locale is: "HH.MM.SS".

0
0

You are mixing the display types of numbers in your spreadsheet.

<td class="text">1000</td><td>1000.00</td><td>1000,00</td><td>1.000,00</td>

Note that the first number is 1000, the second has a period to separate the decimal, the third has a comma to separate the decimal (as does the last).

If you make them all consistent - period for decimals, comma for thousands separator, everything should work.

The period thousands separator and comma decimal separator is a European style which Excel defaults to Italian for. It then gets confused by the one number that doesn't fit the pattern.

1
  • The values are just examples, I intently used different formats for the same value, just to show the difference. Jun 21, 2011 at 13:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .