Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-1539

grouping and parsing regressions in convertNumber

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.2.12-core
    • None
    • None

    Description

      Grouping regression caused by:
      https://issues.apache.org/jira/browse/TRINIDAD-1534

      The fix is to replace this:
      balance = ints.substring(0, toMuch) + groupingSeparator;

      with this:
      balance = (counter < 4) ? ints.substring(0, toMuch) : ints.substring(0, toMuch) + groupingSeparator;

      The reason I didn't notice this mistake is that I was only testing with integers containing 4 or more digits.

      Parsing regression caused by:
      https://issues.apache.org/jira/browse/TRINIDAD-1537

      The fix is that instead of calling a function like this:
      stringToNumber(numberString);

      you need to call it like this:
      this.stringToNumber(numberString);

      This was a stupid js mistake; I didn't catch it because I was testing by typing just a number into the percent field, in which case the percent symbol is automatically appended, and only the TrNumberFormat.prototype.stringToNumber code path is hit. If you type in the percent symbol, then the TrNumberFormat.prototype.stringToPercentage code path is hit.

      Attachments

        1. 1.2.11.4-branch_groupingParsing.patch
          1 kB
          Cale Scholl
        2. trunk_groupingParsing.patch
          1 kB
          Cale Scholl

        Activity

          People

            Unassigned Unassigned
            cale.scholl Cale Scholl
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: