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

Negative percent parsing in decimalbox

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.5.0
    • 6.5.8.1, 8.6.0.1, 9.0.0, 9.0.1.2
    • ZK Client Engine
    • Security Level: Jimmy
    • 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

      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"
       

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

              Created:
              Updated:
              Resolved:

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