andersnm / ExcelNumberFormat

Parse and render Excel number format strings
MIT License
79 stars 27 forks source link

Default precision for double and float has changed in Core 3.0 #20

Closed Pankraty closed 4 years ago

Pankraty commented 4 years ago

Hi!

At ClosedXML we have an issue (ClosedXML/ClosedXML#1318) regarding a precision used for formatting double and float values by default. Before .net Core 3.0, the values 17 and 7 were used, respectively, but starting from 3.0 they've changed it to 19 and 9. Here is a blog post with more details on a subject (https://devblogs.microsoft.com/dotnet/floating-point-parsing-and-formatting-improvements-in-net-core-3-0/).

As a consequence, a few tests in ClosedXML started to fail if the test project targets netcoreapp3.0, the same happens with TestEmptyFormatString in ExcelNumberFormat.

To make the library environment-independent I suggest specifying precision explicitly. The PR will come in a minute.

Cc @igitur, @lahma