Forum Discussion

Tie CHENG's avatar
Tie CHENG
Brass Contributor
Aug 02, 2021
Solved

Reliable way to determine the argument separator of Excel formulas

Hello,

 

When we develop Excel add-ins by JavaScript API, we need to determine the argument separator of Excel formulas. For some environments it is `,` (comma); for some environments it is `;` (semicolon). I don't know if there are other possibilities.

 

It seems that there is no an Excel JavaScript API to get that directly, please correct me if I'm wrong.

 

Another possibility is to get the language of the user. But where can we find a match table of language and the argument separator?

 

Does anyone have a reliable way to get this information?

 

  • Tie CHENG 

    You might get the decimal separator:

    const systemDecimalSeparator = context.application.cultureInfo.numberFormat.numberDecimalSeparator;

    If it is a point, the list (argument) separator will be comma; if it is a comma, the list separator will be semi-colon.

3 Replies

  • Tie CHENG 

    You might get the decimal separator:

    const systemDecimalSeparator = context.application.cultureInfo.numberFormat.numberDecimalSeparator;

    If it is a point, the list (argument) separator will be comma; if it is a comma, the list separator will be semi-colon.

    • Tie CHENG's avatar
      Tie CHENG
      Brass Contributor

      HansVogelaar 


      "If it is a point, the list (argument) separator will be comma; if it is a comma, the list separator will be semi-colon." ==> are you really sure that it is always the case?

Resources