pub.string.NumericFormat

Hi,

I’m having some trouble with this built-in service,
when i set the input like
num = 12.34
pattern ###.##

The output is 12,34

I was expecting a . as numeric separator

I found that the locale variable from java for numeric separation is ,
(getDecimalSeparator)
wM 6.5 IS SP2 is starting as a service,
OS is MS Server 2003 with a french user

How can I configure the numeric separator
in order to obtain 12.34 as a result from NumericFormat ?

can you help me ?

Thanks

am checked numericFormat, with your inputs
num = 12.34
pattern ###.##

Its giving currect output → 12.34, and i am using 6.5

Can you cross check again?

Thanks & Regards,
ArulChristhuraj. A

Thanks for your answer,

I already double check :wink:
I think it deals with the Locale used by webMethods

If you could retrieve the Locale you are currently using
public static Locale getDefault()
and retrieve the decimal Separator from
DecimalFormatSymbols.getDecimalSeparator()
you should obtain a .
When I run a java service like this, I have a ,

What locale is set in the operating system you are using? In Windows you do this in Control Panel - Region and Language Settings.

Mark

Hi,

Regional setting are all in french (date, time and numeric)

Do you want to override the locale-specific settings only for this built-in service or for eveything in IS that is locale-aware?

You can modify the command that starts java in your server.bat file to pass in the properties to set the locale to something other than the French locale that is set at the OS-level, but I’m not quite sure what you’re really attempting to accomplish.

java -Duser.language=en -Duser.country=US ... [I]<rest of java command line>[/i]

Mark

Thanks for your reply.

I think I already tried this last week
but i’ll try again tomorrow this two.

Hi,

I just tried to add this two options in server.bat

%JAVA_RUN% -DWM_HOME="%WM_HOME" -Duser.language=en -Duser.region=US ...

doesn’t change anything,
I’m keeping the same behaviour on numericFormat ,
and my test service always returns fr and , as Locale.getDefault().getLanguage() and DecimalFormatSymbols.getDecimalSeparator()

I’m start IS as a service on a W. Server 2003
IS using his own jvm 1.4.2_07

Thanks again for your help

Sounds like the NT service may not be picking up the changes to your server.bat. Can you try this again when starting IS from the command line?

If those props are being read then your getLanaguage(), getCountry() and getDecimalSeparator() should no longer return the default values read from your OS locale settings. Since those settings still show their default values, the props are not being picked up.

Mark

If IS is restarted using the Restart button in Administrator, then changes to the settings in the .bat are not picked up.

Thanks Rob for this advice

Mark, you’re right,

when I start the IS using command line, it’ OK
my test service return en and .
and NumericFormat return 12.34
but when I use the service, it doesn’t take the properties
keeping fr and , and 12,34

For test server it’s OK to start from the command line,
but for the production server it’ll not be possible
How should I configure the service under windows ?

You probably need to recreate the NT Service for IS. There is a batch file in the \bin folder that can be used to remove the old one and create the new one with new parameters. Pretty sure this is covered in the Administrator’s guide, but its been awhile since I looked for this info.

Mark

I just tried uninstalling the service (installSvc.bat unreg)
and re installing it using installSvc.bat

the new one doesn’t take the properties

Try the SaveSvcParams.bat file instead.

Usage: SaveSvcParams /classpath <Java classpath> 
/jvm <JVM root directory> /binpath <path>  
/jvmargs <JVM arguments> /progargs <program arguments> 
/svcname <service name>

That utility does not appear to be documented in the IS Administrator’s guide or the Installation Guide and searching for it on Advantage turns up zero hits. Go figure.

Mark

Thank you very much,

I didn’t try SaveSvcParams directly
but
SaveSvcParams is used by server.bat when starting IS as a service
it takes %JAVA2_MEMSET% in /jvmargs

by adding -Duser.language=en -Duser.region=US in JAVA2_MEMSET
I was able to start in english the IS service

Thanks