on 12-19-2013 11:03 AM
When retrieving data from a webservice a value of 100.00 is converted to 10000. This is because our decimal symbol is a , instead of a . (dot).
When we change the settings in the registry everything works fine. We prefer not to do this.
It is possible to change something in the .cs file to set the decimal for the webservice to . instead of using the regional settings?
We could then recompile the .cs file. I mean the .cs file the PB 12.5 generates when creating the objects for the webservice.
Thanks in advance,
Eric
Erik, I am just guessing here, never tryed it before myself - did you try adding this code into the constructor even of your web service cs file:
//----------------------------
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
//--------------------------
Wishful thinking tells me that this should help, even though I have no idea what will happen to the code once the service call is over....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are you speaking about Classic or .NET?
I did not try it in .NET, but I think you can specify culture info there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Eric;
We have the same issue in Canada for money display in French vs English.
However ... I am confused as our WS components are culture neutral. That is to say the WS's just return and XML result set of decimal {2} to the client caller. Its then up to the client to convert (apply) the correct display mask to the decimal XML field - for example in French 1.999,99$ and $1,999.99 in English while the WS just returns 199999.
Can you elaborate on your issue? Are you trying to convert the decimal value into a display value in your WS vs the user's client application?
Regards ... Chris
I think, Erik is trying to use the decimal value, which arrived from WS in calculations without any formatting. Correct me if I am wrong.
We had this issue several years ago, but we wrote all our web services culture-neutral since then, just like you. I wish there was a function in PB, which would set the utilized .NET framework to a specific culture, then the whole problem would go away by itself.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.