Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      In germany floating piont numbers are divided by a comma: 12,44 in germany would
      be 12.44 in english.
      So when I want to insert a floating point number into a XMLConfiguration like this:
      [code]
      xml.addProperty("tables.table.fields.field(-1).name", "Preis");
      xml.addProperty("tables.table.fields.field.type", "single");
      xml.addProperty("tables.table.fields.field.value", "11,99");

      try

      { xml.save(); }

      catch(ConfigurationException x1){}
      [/code]

      it leads to this:

      <name>Preis</name>
      <type>single</type>
      <value>11</value>
      <value>99</value>

      The (german) number 12,99 is split into two <value>-sections and not put into
      one (<value>12,99</value>).
      This also happens if you want to put for example a name and surname into one
      String, divided by a comma the same problem occurs.

        Activity

        Hide
        Oliver Heger added a comment -

        No need to excuse, I guess the documentation could be better in this area.

        Show
        Oliver Heger added a comment - No need to excuse, I guess the documentation could be better in this area.
        Hide
        Jakob added a comment -

        Thanks!

        That seems to solve the problem!

        I guess I should take a closer look before reporting a bug next time...!

        JSP

        Show
        Jakob added a comment - Thanks! That seems to solve the problem! I guess I should take a closer look before reporting a bug next time...! JSP
        Hide
        Oliver Heger added a comment -

        You can try one of the following:

        • There is a static setDelimiter() method in AbstractConfiguration that allows
          you to change the (globally used) delimiter used for String splitting. For
          instance you can set this to 0 and disable splitting at all.
        • When adding a property you can escape the split character with a backslash. So
          you can write
          config.addProperty("property.name", "11
          ,99");

        HTH

        Show
        Oliver Heger added a comment - You can try one of the following: There is a static setDelimiter() method in AbstractConfiguration that allows you to change the (globally used) delimiter used for String splitting. For instance you can set this to 0 and disable splitting at all. When adding a property you can escape the split character with a backslash. So you can write config.addProperty("property.name", "11 ,99"); HTH

          People

          • Assignee:
            Unassigned
            Reporter:
            Jakob
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development