Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4169

number formatter adds prefix if format suffix is longer than format string

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 8.6.1
    • 5.0.0, 8.6.1
    • None
    • Security Level: Jimmy
    • None

      Steps to Reproduce

      http://zkfiddle.org/sample/29g96nl/1-formatter-string-prefix
      run fiddle

      each intbox / doublebox uses a format with a suffix (for example, to show the units after a number)

      Current Result

      If the unit label is longer than the format and the format string ends with #0, the first Nth characters of the suffix are added as prefix, where N = suffix length - format string lenght

      Expected Result

      Prefixes shouldn't be added in this case

      Debug Info

      generated here:
      https://github.com/zkoss/zk/blob/db507648f04ab391d471a61dec5fed7d3a6c3a3e/zk/src/archive/web/js/zk/fmt/numfmt.js#L297-L304

      Root Cause

      Workaround

            rudyhuang rudyhuang
            MDuchemin MDuchemin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                3h