Use Locale.FRENCH with "." decimal separator instead of ","

hi,
i need to change the decimal separator to "." for the whole application when the Locale is French. (i don't want to change the locale because of date and ok cancel button labels etc...)
i though the call DecimalFormatSymbols.getInstance().setDecimalSeparator('.');
would change the decimal for the whole application but it doesn't.
here is a little test case
//display a JSpinner with Locale.US we have the "." separator it's ok
Locale.setDefault(Locale.US);
JSpinner spinner = new JSpinner(new SpinnerNumberModel(1.1d,null,null,1d));
JOptionPane.showInputDialog(spinner);
Locale.setDefault(Locale.FRENCH);
//i though it would change the symbol for the default instance so also for all jvm
DecimalFormatSymbols.getInstance().setDecimalSeparator('.');
//display a JSpinner with Locale.FRENCH we have the "," separator it's not ok so previous line don't work
JSpinner spinner2 = new JSpinner(new SpinnerNumberModel((Double)spinner.getValue(),null,null,1d));
JOptionPane.showInputDialog(spinner2); i will appreciate any help.
thank you
Julien Blaize

>
DecimalFormatSymbols.getInstance().setDecimalSeparator
//display a JSpinner with Locale.FRENCH we have the
"," separator it's not ok so previous line don't
work
JSpinner spinner2 = new JSpinner(new
SpinnerNumberModel((Double)spinner.getValue(),null,nul
l,1d));
JOptionPane.showInputDialog(spinner2); You figured out how to change the separator, but you promptly threw away the DecimalFormatSymbols object without using it.
JSpinners have "Editors". You want to look at the JSpinner.NumberEditor probably, and most likely you will want to find a way to provide your own number format for the JFormattedTextField that it uses to display numbers.
Regards,
John O'Conner

Similar Messages

  • Project in dutch language, but use a point as decimal separator (not comma)

    I am working with Haley v9.4.1.71.
    I am preparing a demo for coming wednesday in which I want Haleys to work together with Siebel. I have now ran in to a problem for which I can’t find the solution. I have made the rules in the Dutch language wich all works fine. As it seems it also uses the dutch format for numbers, this means that the decimal separator is a comma instead of a point. Siebel however, requires the decimal separator to be a (point).
    Data delivered from Haleys to Siebel is in the current situation therefore converted incorrectly.
    My question is:
    How can I keep the dutch language, but use the point as a decimal separator (instead of the comma).
    Thing I have tried already:
    - Configure the file hi-servlet.properties with the Haley Interactive Configuration Tool
    The ‘Application Output Numeric Format’ is #,###,###,##0.###############
    This looks correct, but still in the User Interface the comma is used as the decimal separator.
    - Set the Windows Regional and Language Options (Tab Regional Options) to English(United States) and customized the Decimal symbol to a point.
    - I have also looked in the Folder C:\Program Files\Haley\Office Rules 2008\Language\Dutch but couldn’t find specific settings for the comma separator
    I hope you can help me solve this issue.
    Sake Kampen

    Thank you for the reply.
    The problem to upgrading to v10 is that we make use of a OPA <-> Siebel integration developed by the local Dutch Oracle pre-sales team. And I don't know if we can replicate what Oracle has done for us if we upgrade.
    But the problem I'm having doesnt lie with the connection but with OPA itself, in OPA the decimal separator is a comma where I want it to be a point. This problem only exists when I create a Dutch project, when I create an English project (on the same windows environment with the same regional settings) the decimal separator is a point.
    I have advanced a little bit, but I’m not quite there yet.
    Haleys seems to use the Regional settings of Windows.
    The regional settings of my Windows-installation was English, so I temporarily went to Dutch to see what the settings were there. Ofcourse the numberformatting was in the dutch way with a comma as the decimal separator. So I changed this to a point and clicked ‘Apply’. Then I changed the language back to English and clicked ‘Apply’.
    In Haleys the same error persisted.
    So I went back to the regional settings of windows, and there I went back to dutch (English was still selected) and saw to my surprise that the ‘corrected’ decimal separator for dutch was set back to its default.
    So I changed it again to a point and now kept the dutch regional setting, and tested Haleys again. The behaviour of Haleys then changed. But surprisingly the decimal signs are now deleted.
    e.g.:
    a value derived from a table in excel is transformed as follows
    in Excel: 28.5 ==> in Haleys: 285
    Provided by user in Haleys: 543.1234 ==> shown in Haleys summary screen 5.431.234
    I can provide decimal numbers and they seem to be accepted, but if I show them in the summary screen (using the%%) I see that every number is rounded to a whole one in the way described above.
    Are you certain this is a known issue that has been adressed in Haleys 10?

  • Using comma (,) as a decimal separator

    I know this isn't the right place to ask, but I cant get excel to use comma as a decimal separator.
    All is set up right in system preferences and I still cant get it to work in excel.
    So Im asking if any one know how to make the comma to be used for the decimal numbers and dot for thousands.
    Or if any one can explain this to me, or better do it for me.
    http://www.macosxhints.com/article.php?story=20050926170928881
    Many thanks

    Hi, Sven.
    You might want to search or post on the Excel group you can find on the Microsoft Mac Support - Newsgroups page. These are Google Groups with active participation from MS product users, including a variety of expert users.
    I don't mean to send you somewhere else, but I've found numerous answers there for folks with questions related to MS products. Accordingly, it has often proved to be the first, best place to look for answers to questions such as you are asking.
    When you post your question there, be sure to state the version of Excel you are using.
    Good luck!
    Dr. Smoke
    Author: Troubleshooting Mac® OS X

  • How can I use Local SPAN with RSPAN ??

    How can I use Local SPAN with RSPAN ??
    I want to mirror traffics from ISP-A and ISP-B to Anomaly-detector module.
    so I had configured like this...
    C6500-A
    vlan 1000
    name RSPAN
    remote-span
    monitor session 10 source interface Gi5/1 - 2 rx
    monitor session 10 destination remote vlan 1000
    monitor session 20 destination anomaly-detector-module 3 data-port 1
    monitor session 20 source remote vlan 1000
    interface GigabitEthernet1/13
    switchport
    switchport trunk encapsulation dot1q
    switchport trunk allowed vlan 1000
    switchport mode trunk
    no ip address
    C6500-B
    vlan 1000
    name RSPAN
    remote-span
    monitor session 10 source interface Gi5/1 - 2 rx
    monitor session 10 destination remote vlan 1000
    interface GigabitEthernet1/13
    switchport
    switchport trunk encapsulation dot1q
    switchport trunk allowed vlan 1000
    switchport mode trunk
    no ip address
    end
    but it was not working..
    it wasn't any change of input packet hit count when
    I'd enter a command 'show anomaly-detector module 3 data-port 1 traffic'
    was upper configuration wrong..?
    Can I use VACL configuration ?

    try to change "monitor session 10 destination remote vlan 1000 " to "monitor session 10 destination anomaly-detector-module 3 data-port 1 " on C6500-A

  • How to use Time Format with decimal to calculate races cars. ss,ddd ?

    In excell there are a user defined format MM:SS.000 very convenient to use in races with decimal precision.
    So in a race car we can have lap times like
    Car 1 - 1:23.234
    Car 2 - 1:23.132
    so the diference can be calculate and the result is 0.102.
    But in NUMBERS therer are no way to use with this precision.
    Somebidy has the same problem?

    Hi hi ni,
    I'm not sure if I understood you, but you can try doing this.
    Create a variable for 0calyear. The user will input the year.
    In the report you use this:
    0calmonth - NumberOfEmployeesKF
    If the user enters 2008, then it will show:
    01.2008 - nnn
    02.2008 - xxx
    03.2008 - zzz
    Hope this helps.
    Regards,
    Diego

  • ODI-HFM issue with decimal separator

    Hi all,
    We are extracting data from an HFM application A and loading into an HFM application B.
    Example:
    Data extracted from applicaiton A = 21.742.139,55
    Data loaded to application B (verified from Explore Data and Smart View) = 2.174.213.955,00
    Is data loading with ODI-HFM taking the regional settings?
    Any suggestions?
    If we extract data with HFM Client (logged on with the same user configured in HFM Data server) from application A and load it into application B, data is correct in application B.
    Current configuration is:
    - User preferences for HFM Application A
         * Decimal separator = ","
         * Thousands separator = "."
    - User preferences for HFM Application B
         * Decimal separator = ","
         * Thousands separator = "."
    - Regional settings of the server where the agent is running (English US)
         * Decimal separator = "."
         * Thousands separator = ","
    This setting is the same for all HFM application servers
    - ODI Datastore HFMDatastore
         * Decimal separator set to "," (this setting was changed to see if solved the issue)
    - ODI Datastore for staging table
         * Decimal separator set to "," (this setting was changed to see if solved the issue)
    - Language Settings for DB (American English)
    Thanks in advance!

    Hi Pls Use This
        For Decimal Separator other than . we need to Code to Convert , See This Code Below and Do the Code
    Private Function ReturnQty(ByVal Qty As String) As String
    Dim strQty As String
    Dim strSQL As String
    Dim strSeprtr As String
    Dim objRS As SAPbobsCOM.Recordset
    strSQL = "SELECT ThousSep FROM OADM"
    Set objRS = oSBC.oDICompany.GetBusinessObject(BoRecordset)
    objRS.DoQuery (strSQL)
    If Not objRS.EOF Then
            strSeprtr = objRS.Fields.Item("ThousSep").Value
    End If
    If strSeprtr = "," Then
    ReturnQty = Qty
    ElseIf strSeprtr = "'" And Len(Qty) <= 6 Then
    Qty = Replace(Qty, ",", ".")
    'Qty = Replace(Qty, ",", ".")
    ReturnQty = Qty
    Qty = Qty
    ElseIf strSeprtr = "'" Then
    Qty = Replace(Qty, "'", "")
    'Qty = Replace(Qty, ",", ".")
    ReturnQty = Qty
    Qty = Qty
    ElseIf strSeprtr = "." And Len(Qty) <= 6 Then
    Qty = Replace(Qty, ".", ",")
    Qty = Replace(Qty, ",", ".")
    ReturnQty = Qty
    ElseIf strSeprtr = "." Then
    Qty = Replace(Qty, ".", "")
    Qty = Replace(Qty, ",", ".")
    ReturnQty = Qty
    End If
    End Function
    Mohamed Zubair

  • Big issue with decimal separator

    regional settings of machine where client & server reside are for european country (decimal separator is ",")
    sap b1 decimal separator is set also for ",".
    exception occurs when I set in code, for a edittexts' datasource of type SUM a decimal value using ",". If I set the value using "." it works. how the $%#$% is this possible?

    Hi Pls Use This
        For Decimal Separator other than . we need to Code to Convert , See This Code Below and Do the Code
    Private Function ReturnQty(ByVal Qty As String) As String
    Dim strQty As String
    Dim strSQL As String
    Dim strSeprtr As String
    Dim objRS As SAPbobsCOM.Recordset
    strSQL = "SELECT ThousSep FROM OADM"
    Set objRS = oSBC.oDICompany.GetBusinessObject(BoRecordset)
    objRS.DoQuery (strSQL)
    If Not objRS.EOF Then
            strSeprtr = objRS.Fields.Item("ThousSep").Value
    End If
    If strSeprtr = "," Then
    ReturnQty = Qty
    ElseIf strSeprtr = "'" And Len(Qty) <= 6 Then
    Qty = Replace(Qty, ",", ".")
    'Qty = Replace(Qty, ",", ".")
    ReturnQty = Qty
    Qty = Qty
    ElseIf strSeprtr = "'" Then
    Qty = Replace(Qty, "'", "")
    'Qty = Replace(Qty, ",", ".")
    ReturnQty = Qty
    Qty = Qty
    ElseIf strSeprtr = "." And Len(Qty) <= 6 Then
    Qty = Replace(Qty, ".", ",")
    Qty = Replace(Qty, ",", ".")
    ReturnQty = Qty
    ElseIf strSeprtr = "." Then
    Qty = Replace(Qty, ".", "")
    Qty = Replace(Qty, ",", ".")
    ReturnQty = Qty
    End If
    End Function
    Mohamed Zubair

  • Problem with decimal separator

    How to change default settings for decimal and group separators?
    Example:
    - 10g database
    - APEX v.3.1.2.00.02
    0.00: S H O W: application="1" page="6" workspace="" request="" session="1327891581523707"
    0.00: Language derived from: FLOW_PRIMARY_LANGUAGE, current browser language: hr
    0.01: alter session set nls_language="*CROATIAN*"
    0.01: alter session set nls_territory="*CROATIA*"
    0.01: NLS: CSV charset=*EE8MSWIN1250*
    *0.01: ...NLS: Set Decimal separator="."*
    *0.01: ...NLS: Set NLS Group separator=","*
    - 11g database
    - APEX v.3.1.2.00.02
    0.00: S H O W: application="1" page="6" workspace="" request="" session="124256584707880"
    0.00: Language derived from: FLOW_PRIMARY_LANGUAGE, current browser language: hr
    0.00: alter session set nls_language="*CROATIAN*"
    0.00: alter session set nls_territory="*CROATIA*"
    0.00: NLS: CSV charset=*EE8MSWIN1250*
    *0.00: ...NLS: Set Decimal separator=","*
    *0.00: ...NLS: Set NLS Group separator="."*
    Both applications are same and in both applications Application Primary Language globalization attribute is set to Croatian (hr) but I'm getting different decimal and group separators.
    Querying v$nls_parameters view I saw that, in first case NLS_NUMERIC_CHARACTERS parameters are set same on database and apex ('.,') but in second case they are different. On database is '.,' but on apex application ',.'
    Why?
    Please help!

    Make changes in the regional configurations of your PC.
    Maybe its solve your problem.

  • Using local variables with a case structure

    I recently decided that I didn't want to nest a bunch of case structures for a program I am creating. I have two variables, N1 and N2, and I want to say execute Case 1 if the integer input to the terminal is less than N2. Case 2 if the integer input into the terminal is greater than N2 but less than N2+N1. Case 3, integer greater than N2 + N1, but less than N2+N1+N2. Case 4, you guessed it, Greater than N2+N1+N2, but less than N2+N1+N2+N1. When I try to type the variable name into the bar and use the ... like you do with integers it changes the variable name to a string.
    Am I just thinking of this the wrong way? I have a sensor setup in a square and I am using a matrix card hooked up to the sensor bundle to send signals from each sensor to each other sensor, but not for those along the same sides.
    Tom

    I see the nested case structures which is what I didn't want to do, but I will have to because I am tired of looking at this. Thank you for the help on this. I appreciate it.
    The sensor network is shown in the image included.  Lets say we number the sensors in a clockwise direction starting on the lower left hand corner. Each element needs to both send and recieve data to all other elements except for the one in the row it is in. So sensor 1 would sent to sensor to sensors 5 - 18. Then sensor 2 would send to 5 - 18. Sensor 5 would sent to 1 - 4 and 10 - 18. Etc.
    Lets say if this were a circular array it would be easy. Two nested while loops. And the only condition I need to worry about is that sensor N is not both sending and recieving at the same time. Each while loop, or for loop - doesn't matter, will start at 0 and go to N-1. Each i and j will have +1 added to them, and as long as they are not equal preform the data operation. 
    Just some fun logic to think about
    Tom
    Attachments:
    rectangular.jpg ‏12 KB

  • Use local storage with freenas

    Hello,
    a common trick that you can do in ESXi is this: you put a nas appliance (freenas) in local storage as iscsi target and use the same esxi as iscsi initiator.
    Can I do a similar thing in oraclevm?
    Thanks,
    Mario

    883038 wrote:
    a common trick that you can do in ESXi is this: you put a nas appliance (freenas) in local storage as iscsi target and use the same esxi as iscsi initiator.
    Can I do a similar thing in oraclevm?You can present storage from one VM to another VM, but I wouldn't recommend using for shared/repository storage as the agent will startup before the guest does, and the storage will not be available during boot.

  • Decimal Separator in SELECT Clause

    Hi
    I have the following decimal format parameters:
    SQL> select value
    2 from v$nls_parameters
    3 where parameter = 'NLS_NUMERIC_CHARACTERS';
    VALUE
    If I show a number with decimal I get a comma as the decimal separator
    SQL> select 10/100 from dual;
    10/100
    ,1
    But if I use a decimal separator in the SELECT clause I get:
    SQL> select 100 * 1,1 from dual;
    100*1 1
    100 1
    It doesn't work. But using a period as the decimal separator works:
    SQL> select 1.1 * 100 from dual;
    1.1*100
    110
    Maybe this is something I've never had to deal with before but I thought that the numeric format applied to the sql results and also the numbers that you used in the sql clauses.
    Regards,
    Néstor Boscán

    Hi,Néstor,
    user594312 wrote:
    ... I thought that the numeric format applied to the sql results and also the numbers that you used in the sql clauses.No; it applies to results, and it can affect implicit conversions, but it doesn't apply to SQL code.
    The period (or dot, '.') is always the decimal separator in numeric literals. There is no way to change that.
    Think how confusing it would be if it did apply to SQL code! For example:
    WHERE   num_col  IN (1,2)Are we comparing num_col to 1 value or 2 values? Whichever it is, what if we wanted to do the opposite?
    If you really wanted to use comma as the decimal separator, you could have to use strings, not numbers, and that could be a lot less efficient.
    For example:
    SELECT  100 * TO_NUMBER ('1,1')    -- This assumes your NLS settings are correct
    FROM    dual;Of course, efficiency won't be an issue when you're selecting 1 row from dual.

  • Select changing decimal separator type

    I'm consulting a database which use comma "," as a decimal separator for numbers. I would like to make a select which takes those numbers using point "." as a decimal separator.
    for example I have a value 1,34 in the database, I would the make a select which returns this value as 1.34

    Or:
    http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1224836384599#tom38829286554804
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/initparams129.htm#REFRN10126
    http://www.oracle.com/pls/db102/search?remark=quick_search&word=nls_numeric_characters&tab_id=&format=ranked

  • Using iPhone 3Gs with noise canceling headset

    I recently upgraded from a 3G to a 3Gs. I used the 3G with a corded connection from the audio jack to a Lightspeed Zulu aviation noise canceling headset. It worked great. However, with the 3Gs I can hear the person I am talking to fine, but they say they can barely hear me. This never happened when I used my 3G phone with the NC headset. Is there a volume adjustment on the outgoing audio in the 3Gs?

    So my question is, can i use IPhone 3Gs with my network instead of AT&T?
    No, if the phone is bought from AT&T in the US, it is locked to AT&T and AT&T do not offer unlocking, so it would only be able to be used with AT&T.
    There doesn't appear to be an official iPhone provider in Egypt, so you would have to buy an unlocked one from another country:
    http://support.apple.com/kb/HT1937
    Note that for any repairs or service the iPhone would have to be returned to the country of purchase.

  • For Working offline - Which one to use -  local database caching or reliable messaging?

    Hi,
    I am working on a mobile application with lcds where there is a feature to be implemented. The user can use the application in airplane mode and be able to automatically send requests to server when he comes online. After some research,  I found that I have to use a feature in the documentation called ocasionally conencted clients, which uses local database with dataservice.savecache() and offline adapter. I also found another feature called reliable messaging which takes care of sending the pending requests when the user comes online, but not sure if this feature supports offline mode for longer periods. The documentation mentioned that reliable messaging is only good for transient network disconnects, meaning disconenction for shorter time.
    Can anybody please confirm which is the right feature that best suits this requirement?
    Thanks,
    Swathi.

    Hi Ashish,
    Thank you so much for the resource. One more question, The code in the resource link,  has calls to Dataservice.disconnect() and Dataservice.connect() on the buttons. If my user need not bother to click on those buttons for connections and just set his phone to airplane mode and start working, I am using SocketMonitor class to monitor for network connection and then perform the Dataservice.connect(). In that case, I have problems when network is connected, the data service seems connected automatically some times and not connected other times resulting in errors. I am using autoConenct = true. How can I handle this? Do I have to call disconnect when socket is not available and then call conenct when it is available, things like that? Or Is there any other way to implement this without using SocketMonitor class?
    Thanks,
    Swathi.

  • How to change the local decimal separator on windows xp OS ?

    Hi all,
    I would like to known how to change programmatically with LV8.5 the local decimal separator ? I want to force this parameter to the point separator, so to be sure that it's not the comma (if it's the comma when installing the executable, the ascii files are not read properly).
    Thanks.
    Wilfried.

    GerdW wrote:
    Hi Wilfried,
    you can use the format code "%.;" to get points as decimal separator in each string formatting function.
    This is the important one. Put it at the beginning of every format specifier!
    Some functions have a boolean control 'use local decimator' make sure this is 'F'
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

Maybe you are looking for