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

Negative percent parsing in decimalbox

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 6.5.8.1, 8.6.0.1, 9.0.0, 9.0.1.2
    • Fix Version/s: 9.5.0
    • Component/s: ZK Client Engine
    • Security Level: Jimmy
    • Labels:
    • Environment:

      We are running ZK CE 8.6.0.1 in a SpringBoot app. Also tested it on zkfiddle.org.

      We are using MVC with SelectorComposer

      Description

      Using the percent format in a decimalbox parsement and validation of negative percent value fails. We were able to track it back to zk.BigDecimal#$toString()

      <window>
          <decimalbox format="#%"/>
      </window>

      When using the above zul and entering -3% in the decimalbox on validation it says - from a client error that we should enter a number instead of .-3

      In the process a zk.BigDecimal is created with the value -3 and the set its precision to 2. The $toString() call on such a BigDecimal gives an invalid string representation.

       

      var num = new zk.BigDecimal(-3);
      num.setPrecision(2);
      num.$toString();
      // ".-3"
       

        Attachments

          Activity

            People

            Assignee:
            rudyhuang rudyhuang
            Reporter:
            nalanto nalanto
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 4 hours
                4h
                Logged:
                Time Spent - Not Specified
                Not Specified