How to get Decimal and Thousand separator of user personal settings in SharePoint JSOM

for example I can get date formatted using SP.Utilities.Utility.formatDateTime ...

IS there any way to get user's personal setting's Decimal Separator?

  • make no sense? user's personal setting's Decimal Separator?, do you mean return all user personal settings with decimal as the separator? – Ali Jafer Oct 26 '17 at 12:27
  • @Ali I asked that for a particular Region Locale there will be . or , as a decimal separator, I need that. – codemirror Oct 26 '17 at 12:47

I'd probably try something like this:

var number = 1000234.033;
var currentCulture = _spContextInfo.currentCultureName;

Also you could use toLocaleString() if the user is already on his/her locale region, it will pick that up.

See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.