none
Excel Task Pane App numberFormat ignored with other than en-US display language RRS feed

  • Question

  • Hello,

    My tableOptions format my cells fine when the display language is en-US. However testing in the fr-FR display language the numberFormat is not set. Here is my code:

    tableOptions.cellFormat.push({ cells: { column: 14 }, format: { alignHorizontal: "right", numberFormat: "#,###.00" } });

    Should I use UIStrings in the numberFormat parameter? If so what would I use to format the number similarly in French? 

    Thank you


    J Donnelly

    Wednesday, September 17, 2014 8:25 PM

All replies

  • Hi John,

    >>My tableOptions format my cells fine when the display language is en-US. However testing in the fr-FR display language the numberFormat is not set<<

    What's mean of 'display language is in fr-FR'? Did you mean the display language of OS or Excel application?

    I suggest that you set the number format manually and get the format by following steps below:

    You can see what a format string looks like for a standard category in the Format Cells dialog box in Excel with the following steps:

    1. Select a standard format category, for example Currency, from the Category list.
    2. Set the format's options in the right side of the dialog box.
    3. Select the Custom category to view the format string at the top of the Type list.

    You can get more detail about format from link below:
    How to: Format tables in apps for Excel

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, September 19, 2014 6:09 AM
    Moderator
  • Hi Fei,

    Thanks for the response.

    >>What's mean of 'display language is in fr-FR'? Did you mean the display language of OS or Excel application?

    The display language of Excel application is what I mean.

    >>I suggest that you set the number format manually

    I'm not sure what "manually" means in this context. Could you explain please?

    I followed the steps you outlined before asking the question. It doesn't seem to matter what format I set, it is not applied when display language is not en-US.

    The article is good and fairly complete but it doesn't mention culture issues.

    Thanks,


    John Donnelly

    Friday, September 19, 2014 3:04 PM
  • Hi John,

    Thanks for your detail information.

    >>I'm not sure what "manually" means in this context. Could you explain please?<<

    We can set the number format by right click the cell->Format Cells like figure below:
    Does it work for the Excel using fr-FR as display language?

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, September 22, 2014 11:32 AM
    Moderator
  • Hi Fei,

    Yes the format sets manually using fr-FR as display language.

    Thanks for the help


    J Donnelly

    Tuesday, September 23, 2014 12:31 PM
  • Hi John,

    I’m afraid I could not reproduce this issue on my test environment (Office 365 Pro plus FR + Visual Studio 2013 +Office JavaScript API 1.1).

        function setTableFormat() {
            Office.select("bindings#formatTableBinding").setFormatsAsync(
                [{ cells: { row: 2, column: 2 }, format: { alignHorizontal: "right", numberFormat: "#,###.00" } }],
                function (asyncResult) {
                    if (asyncResult.status === "failed") {
                        app.showNotification("Error: ", error.message);
                    }
                });
        }

    Would you please try to update the Office Application to latest version and test it again?  If this issue still exits after updating, I will highly appreciate if you could provide us more detail information to help us reproduce this issue.

    Regards,

    Jeffrey


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, September 26, 2014 3:29 AM
    Moderator