XML setAttribute() with US locale and ',' as a decimal separator

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • boder
    New Member
    • Feb 2008
    • 2

    #1

    XML setAttribute() with US locale and ',' as a decimal separator

    I've set US locale with ',' (comma) as a decimal separator.
    My code :

    Code:
    var xmlObject = new ActiveXObject("MSXML2.DOMDocument.3.0");
    xmlObject.setProperty("SelectionLanguage", "XPath");
    var datasetNode = xmlObject.createElement("dataset");
    datasetNode.setAttribute("name", "test");
    var recordNode = datasetNode.ownerDocument.createElement("test");
    datasetNode.appendChild(recordNode);
    recordNode.setAttribute("limit",5.5);
    gives as result
    recordNode.xml= <test limit="5,5"/>.
    Why the attribute value has a ',' as a decimal separator??? I'm sure it should be a dot: <test limit="5.5"/>.
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    If you've "set US locale with ',' (comma) as a decimal separator."
    and you are now getting the comma as a decimal seperator, what is the complaint?

    If you want it as a period, then why don't you set period as the decimal seperator?

    Comment

    • boder
      New Member
      • Feb 2008
      • 2

      #3
      Originally posted by jkmyoung
      If you've "set US locale with ',' (comma) as a decimal separator."
      and you are now getting the comma as a decimal seperator, what is the complaint?

      If you want it as a period, then why don't you set period as the decimal seperator?
      Hi!
      It is a fragment of a wider application and users can use a different settings.
      In all other settings it work properly, i have a result like <test limit="5.5"/>.
      Only in US locale with',' it goes wrong.

      best regards

      Comment

      Working...