cancel
Showing results for 
Search instead for 
Did you mean: 

PB 12.5 webservice decimal symbol

eric_verhorstert
Explorer
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member329524
Active Participant
0 Kudos

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....

eric_verhorstert
Explorer
0 Kudos

Thanks, I will try this.

To give an example of our problem. There is a field weight. The values we receive back from the webservice are for example

2500

2500.0

2500.00

So, the webservice returns

2500

25000

250000

instead of in all cases 2500.

Former Member
0 Kudos

Hi Eric;

   In our case ... the web service should always return "250000" in a Decimal {2} defined field!

Regards ... Chris

former_member329524
Active Participant
0 Kudos

Are you speaking about Classic or .NET?

I did not try it in .NET, but I think you can specify culture info there.

eric_verhorstert
Explorer
0 Kudos

Allways forget to mention that we use PB Classic.

Former Member
0 Kudos

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

former_member329524
Active Participant
0 Kudos

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.