Created attachment 158977 [details] Example file from Excel Attached file contains a simple macro to set cell number format to percentage with 1 decimal place. This call does not work in Calc with hu-HU locale, but works with en-US locale. Columns("B").NumberFormat = "0.0%" Steps to reproduce: 1. Open attached xlsm file 2. Run the macro in Excel and Calc Actual results: Values in column B: 1 and 12,5 become in Excel 100,0% and 1250,0% and 10.0% and 125.0% in Calc However this works correctly with en-US locale since the decimal separator is dot there, but comma in hu-HU. Expected results: Macro works regardless of locale. LibreOffice details: Version: 7.0.0.0.alpha0+ (x64) Build ID: bc898e2c2784e36ad4d4cdf6d962e39069d2c82d CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win; Locale: hu-HU (hu_HU); UI-Language: en-US Calc: CL
Created attachment 158978 [details] Screenshot of the original document side by side in Excel and Calc after running the macro
Created attachment 158979 [details] Screenshot of the original document side by side in Excel and Calc after running the macro in Calc with en-US locale
Confirmed with: Version: 6.3.3.2 (x64) Build-ID: a64200df03143b798afd1ec74a12ab50359878ed CPU-Threads: 6; BS: Windows 10.0; UI-Render: GL; VCL: win; Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE Calc: CL
There exists a workaround, if you set the locale. However, it is still an inconvenience. Function cellRange_SetNumberFormat( strSourceRange As String, strNumberFormat As String ) As Long REM Sets the Number Format of the specified CellRange to <strNumberFormat>. REM <strNumberFormat> : The desired Number Format specification string (e.g. "0.00"). REM NB. The given Format will be added to the NumberFormats, if it doesn't exist already. Dim aLocale As New com.sun.star.lang.Locale Dim oNumberFormats As Object : oNumberFormats = ThisComponent.getNumberFormats() Dim oSheet As Object : oSheet = ThisComponent.CurrentController.ActiveSheet Dim oRange As Object : oRange = oSheet.getCellRangebyName( strSourceRange ) Dim lFormatKey As Long : lFormatKey = oNumberFormats.queryKey( strNumberFormat, aLocale, FALSE ) If lFormatKey = -1 Then lFormatKey = oNumberFormats.addNew( strNumberFormat, aLocale ) oRange.NumberFormat = lFormatKey cellRange_SetNumberFormat = lFormatKey End Function Sub Main cellRange_SetNumberFormat("B1:B2", "0.0%") End Sub
Dear NISZ LibreOffice Team, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug