qax-os / excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
https://xuri.me/excelize
BSD 3-Clause "New" or "Revised" License
17.64k stars 1.69k forks source link

Number format compatibility #1847

Closed Yiling-J closed 3 months ago

Yiling-J commented 3 months ago

Some of my tests failed using google sheets built-in format code, here are the test cases, the expected results are copy from google sheets but I also check Excel web, results are same:

{"43543.5448726851", "General", "43543.54487"}, // actual  : "43543.5448726851"
{
    "43543.5448726851",
    `_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)`,
    "$ 43,543.54 ",
}, // actual  : "$43,543.54"
xuri commented 3 months ago

Thanks for your issue. This issue has been resolved. Please upgrade the master branch code by go get -u github.com/xuri/excelize/v2@master, and these changes will be released in the next version. Note that the number format repeat control character (*) will be ignored in the formatted result, this behavior was the same when you copied cell value with the same number format in the spreadsheet apps, so the formatted result of number 43543.5448726851 should be " $43,543.54 ".