Numeric precision in Excel 2007 when saving as XML

I had a strange problem saving documents in XML Spreadsheet 2003 format using Excel 2007.

Numerical values ​​seem to randomly change, such as "0.58" - "0.57999999999999996".

What is really strange is that you CANNOT see this problem when you are in Excel. This can only be seen when viewing XML data directly from a text editor.

Has anyone come across this before? If so, is there any fix or workaround?

+3
source share
3 answers

Excel . ( ) . , 0.58 , 0,58.

XML , (, Decimal #).

+4

, Excel 2. .

, "0.58 ". , 0,58 , .NET Decimal, - , , , Excel.

Excel , 15 . , 0,58 , "" 0,58 - 0,58 - , Excel.

Precision As Displayed ( Excel 2007 " Excel" → "" → : → , ) - Excel XML, . , Precision As Displayed , ( ), ( , ). , , , "0.00" , Excel 2, 0,58 XML. , "", 15 Precision As Display.

+2

0.58 IS 0,57999999999999996. 0 , .

Now you can disagree if you use "ordinary" high school math. There is no Excel, but no computers at all. They use a finite set of bits. An accurate representation of 0.58 in binary uses an infinite set of bits, so you lose some of these bits.

0
source

Source: https://habr.com/ru/post/1704132/


All Articles