473,386 Members | 1,883 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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

Expand|Select|Wrap|Line Numbers
  1. var xmlObject = new ActiveXObject("MSXML2.DOMDocument.3.0");
  2. xmlObject.setProperty("SelectionLanguage", "XPath");
  3. var datasetNode = xmlObject.createElement("dataset");
  4. datasetNode.setAttribute("name", "test");
  5. var recordNode = datasetNode.ownerDocument.createElement("test");
  6. datasetNode.appendChild(recordNode);
  7. recordNode.setAttribute("limit",5.5);
  8.  
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"/>.
Feb 22 '08 #1
2 3820
jkmyoung
2,057 Expert 2GB
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?
Feb 22 '08 #2
boder
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?
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
Feb 22 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ksenia Marasanova | last post by:
Hi, I have some problems with locale module. On my workstation, changing locale doesn't have effect: Python 2.3 (#1, Sep 13 2003, 00:49:11) on darwin Type "help", "copyright", "credits" or...
4
by: Roger Leigh | last post by:
Hello, I'm writing a fixed-precision floating point class, based on the ideas in the example fixed_pt class in the "Practical C++ Programming" book by Steve Oualline (O' Reilly). This uses a...
2
by: sprotty | last post by:
I'm writting some classes that deal with XML, and they need to be able to convert from strings to doubles and back. The problem is they should only accept/output strings valid in XML, that is...
4
by: John Bowman | last post by:
Hi, A couple Q's , so I've come to the experts<g>. 1) I need a definitive answer to the following debate. I've got a couple developers who disagree on the following question. We've got an XML...
1
by: Rajesh Gopinathan | last post by:
Hi, I have a locale problem in AIX 5.1 > locale LANG=pt_PT LC_COLLATE="pt_PT" LC_CTYPE="pt_PT" LC_MONETARY="pt_PT" LC_NUMERIC=en_US
3
by: gelbeiche | last post by:
I have a question regarding the following small C program. #include <locale.h> int main() { char* loc = 0; char before,after; int i;
2
by: Claire | last post by:
I'm monitoring key presses in an edit box on a pocket pc device. It's for floating point numbers and Im allowing '-', '0'..'9', #8 plus decimal point character. Ive a function that should return...
5
by: Noah Roberts | last post by:
A lot of my code converts numeric values to strings using boost::lexical_cast, and thus, underneath, with <<. When I activate locales, the thousands separator turns on. We've deemed it not...
3
by: =?Utf-8?B?UGFvbG8=?= | last post by:
I have a table column of SQL smallmoney type which I am updating via a form input field defined as decimal. If I enter, say, 51.09 via the decimal input field (representing $51.09), this is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.