Same numberOfDigitsAfterPoint in several styles
C++ library for creating XLSX files for MS Excel 2007 and above.
Brought to you by:
oxod,
programmeralex
I want two styles that differ in fgColor and have numberOfDigitsAfterPoint=2 so I did:
MS Excel 2010 displays test.xlsx like this:
0.00 0
0.69 1
1.10 3 ...
I want like this:
0.00 0.00
0.69 0.77
1.10 3.08 ...
If I chek cell format of 2nd column in Excel it appears to be set numeric and 0 (zero!) digits afeter point. I want in both column 2 digits after point.
I tried to set st.numFormat.formatString = "0.00" instead of st.numFormat.numberOfDigitsAfterPoint = 2 in both styles and it also work as above. If I set different numberOfDigitsAfterPoint in two styles (suppose 2 and 3) it dysplays correctly. But I want same numberOfDigitsAfterPoint.
Copiled SimpleXlsx-r0.29 with g++ (i686-posix-dwarf-rev0, Built by MinGW-W64 project) 8.1.0 on Windows.
How can I achieve this?
LibreOffice Calc 6.0.2.1 also displays 2nd column of test.xlsx with 0 digits after point.
EDIT:
I can programmatically round values up to 2 digits after point. But I dont thik it's a good solution.
Last edit: bcianyo 2018-07-21
Hi,
Thanks for the detailed description of the problem. This is a library error with the number format.
Please check the new version of the library from the attachment.
Yes. The new version seems to work correctly with my numbers. I created some styles with different digits after point and all of them displays exactly what I want.
Ok. Thank you for testing. Now the library has become even better :-)