如何在脚本中获取公式分隔符? [英] How do I get the formula separator in a script?
问题描述
我有一个基本的Google表格脚本,作为HTML边栏的一部分,我向用户显示了要输入的公式;例如=myformula("bob", "ross")
.这适用于美国和其他许多国家/地区的人,但是有相当多的国家/地区使用;
代替,因此公式看起来像=myformula("bob"; "ross")
.我知道我可能可以通过脚本获取电子表格的语言环境,但是有没有办法获取我应该放置,
还是;
的方法?谢谢!
I have a basic Google Sheets script and as part of the HTML sidebar I show the user the formula to type in; e.g. =myformula("bob", "ross")
. This works for people in the U.S. and a lot of other countries but there are quite a few countries that use ;
instead, so the formula looks like =myformula("bob"; "ross")
. I know I can probably get the locale of the spreadsheet via a script but is there a way to get whether I should put a ,
or a ;
? Thanks!
推荐答案
;
被普遍接受(数组字面量除外).在美国和其他地区,它将自动解析为,
.
;
is universally accepted(except in case of array literals). It'll automatically be parsed to ,
in the US and other locales.
这篇关于如何在脚本中获取公式分隔符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!