NLS Numeric Characters

Hi all,

I’m programming over webmethods 6.0.1.

When i try to perform this arithmetic operation : 1,5 * 1,5 using this flow pub.math:multiplyFloats, it results 225.0.:eek:

However I’m expecting this : 1,5 * 1,5 = 2,25 as i’m using French numeric characters.

I had tried to do this to run my IS : server.bat -debug 4 -Duser.language=fr
but it was in vain. I stil have : 1,5 * 1,5 = 225.0 :mad:

Could anyone help? I’ll be grateful.

Well, i am not sure that this is the best solution, but you could put a mapping step before your multiply, and use the pub.string.replace (from the WmPublic package), and set the searchString to be ‘,’ and the replaceString to be ‘.’ (both without the quotes). Do this for each input and then when the multiply is done, do the reverse pub.stirng.replace to get it back into the format you want.

A better solution would be to use the pub.string.numericFormat function, but it looks like it doesn’t provide access to the underlying Locale :frowning:


According to the docs, the input strings must be in a locale-neutral format. From the service description for pub.math:addFloats:

“For example, calling pub.math:addFloats in a German locale with the arguments 1,23 and 2,34 will result in the value 357, not 3.57 or 3,57.”

dunno… never tried working in a different locale.

Well, once in Belgium, but that was on ActiveWorks 4.1 long ago on a continent far far away…