IRange.NumberFormat not working for non-English regions in Spread 18

Posted by: Peter.Priestley on 30 June 2025, 12:59 am EST

  • Posted 30 June 2025, 12:59 am EST - Updated 30 June 2025, 1:04 am EST

    I have previously discussed on the forum the issue of formatting numeric cells for non-English regional settings. Some fixes were made in Spread 12 and continued to work in Spread 13 (not sure beyond that). However Spread 18 seems to have broken all this. Previous post:

    https://developer.mescius.com/forums/spread-winforms/how-to-set-the-culture-so-spread-works-on-non-english-windows-system

    I am interested particularly in regions where the decimal point is a comma (“,”) and the thousands seperator is a period (“.”), such as Indonesia.

    Fundamental of this was that IRange.NumberFormat accepted format strings in the culture of the system, and would display values using the culture of the system.

    I wrote some code like this to display some formatted values on various systems

            public void TestFormats()
            {
                IWorkbook workbook = fpSpread1.AsWorkbook();
                IWorksheet worksheet = workbook.ActiveSheet;
    
                var range = worksheet.Cells[3, 2];
                range.Value = 1694.5452;
                range.NumberFormat = "0.000";
                range = worksheet.Cells[4, 2];
                range.Value = 1694.5452;
                range.NumberFormat = "0.00";
                range = worksheet.Cells[5, 2];
                range.Value = 1694.5452;
                range.NumberFormat = "0.0";
    
                range = worksheet.Cells[7, 2];
                range.Value = 1694.5452;
                range.NumberFormat = "0,000";
                range = worksheet.Cells[8, 2];
                range.Value = 1694.5452;
                range.NumberFormat = "0,00";
                range = worksheet.Cells[9, 2];
                range.Value = 1694.5452;
                range.NumberFormat = "0,0";
    
            }

    Here are the collated results showing the formatted cells from 3 different runs. I’ve attached this as a png:

  • Posted 30 June 2025, 9:25 am EST

    Hi Peter,

    Thanks for sharing the code snippet.

    We could replicate the issue on our end. Therefore, we have escalated this issue to our developers. [Internal Tracking ID: SPNET-48393]

    We will update you on this as soon as we hear back from them.

    Thanks & regards,

    Aastha

  • Posted 2 July 2025, 9:15 pm EST

    Hi Peter,

    The developers have asked about the culture settings of your operating system. Could you please share this information with us?

    Kind Regards,

    Aastha

  • Posted 3 July 2025, 3:40 am EST - Updated 3 July 2025, 3:45 am EST

    The test system in question is Windows 10 and set for Indonesian (as we support customers in Indonesia).





  • Posted 4 July 2025, 12:57 am EST

    Hi Peter,

    Thanks for the information.

    We have passed it further to our developers.

    Kind Regards,

    Aastha

  • Posted 14 July 2025, 11:35 am EST - Updated 14 July 2025, 11:40 am EST

    Hi Peter,

    We tested this behavior in Microsoft Excel with the system locale set to Indonesia and found that Excel behaves the same way as Spread.NET v18. Therefore, the developers marked it as the intended behavior.

    You can refer to the following GIF to see the result:

    Thanks & regards,

    Aastha

  • Posted 18 July 2025, 5:12 am EST

    I can accept that the NumberFormat should be in English (different to Spread 13).

    However there is still a problem, the second line of the Excel demo displays “1694,55” for a format of “0.00”, but Spread 18 displays “1.695” for a format of “0.00” (refer to the table in my first post above).

    Can you ask the developers to explain the anomaly with 2 decimal places?

    Thanks,

    Peter.

  • Posted 18 July 2025, 7:16 am EST

    Hello Peter,

    Thanks for pointing it out. We’ve also noticed the behavior and shared it with the team. We’ll get back to you as soon as we have any updates.

    Regards,

    Uttkarsh.

  • Posted 22 July 2025, 1:25 am EST

    Hello Peter,

    As per the team, “0,00” is not the correct number format for number groups at all. If you input that code to Excel, Excel will autocorrect it to “#,#00”.

    Spread doesn’t support the auto-correct number format feature. So, not all invalid number formats work with Spread.

    Please ensure a proper number format so that it works in both Spread and Excel.

    Regards,

    Uttkarsh.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels