With a browser, how do I know which decimal separator does the operating system use?

后端 未结 13 2175
不思量自难忘°
不思量自难忘° 2020-11-27 17:05

I\'m developing a web application.

I need to display some decimal data correctly so that it can be copied and pasted into a certain GUI application that

13条回答
  •  感动是毒
    2020-11-27 17:22

    Using other people answers I compiled the following decimal and thousand separators utility functions:

    var decimalSeparator = function() {
        return (1.1).toLocaleString().substring(1, 2);
    };
    var thousandSeparator = function() {
        return (1000).toLocaleString().substring(1, 2);
    };
    

    Enjoy!

提交回复
热议问题