Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Jun 22 '11 at 2:58

This question came from our site for professional and enthusiast programmers.

    
What do you mean with 1000.00, then? With Italian locale, it should be 1000,00 –  stivlo Jun 21 '11 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 '11 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' –  Stef Jun 21 '11 at 13:10

2 Answers 2

up vote 2 down vote accepted

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".

share|improve this answer
    
++1 Nice catch. –  Jean-François Corbett Jun 21 '11 at 18:45

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.

share|improve this answer
    
The values are just examples, I intently used different formats for the same value, just to show the difference. –  Stef Jun 21 '11 at 13:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.