MyFaces Trinidad
  1. MyFaces Trinidad
  2. TRINIDAD-849

NumberConverter (type:currency; locale:fr_FR) does not work

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.1-core, 1.0.2-core, 1.0.3-core, 1.0.4-core, 1.0.5-core, 1.2.1-core, 1.2.2-core, 1.2.3-core, 1.2.4-core
    • Fix Version/s: 1.0.5-core
    • Component/s: Components
    • Labels:
      None

      Description

      The source of this problem is a JDK bug (tested against SUN), where the NumberFormat has some problems

      See here for the Sun JDK:
      http://bugs.sun.com/view_bug.do?bug_id=6318800

      A simple Java-test fails and shows why:

      Doing this:

      String va = "12 345,68 €";
      NumberFormat nf = NumberFormat.getCurrencyInstance(Locale.FRANCE);
      Number n = (Number) nf.parseObject(va);

      and you'll see that n is NULL.

      Why?
      So, here it is:
      the String va contains to blanks (" "), which are between 2 and 3, and
      between 8 and € as well...

      In fr_FR, however, the *grouping separator * is not " ", but it is a
      nb space (\u00a0).

      So, my little test will pass, when the first BLANK (only) is replaced by the
      non-braking space...
      (in that case, the String would look like: "12\u00a0345,68 €"

      I thought, that the NumberFormat actually does parse the object for me.
      Looks like (for fr_FR) I have to create a custom parser...

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Matthias Weßendorf
            Reporter:
            Matthias Weßendorf
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development