Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    bug in isc.NumberUtil.format

    Hi,

    It is impossible to get literal semicolon in output of isc.NumberUtil.format.

    isc.NumberUtil.format(123, "0.00 '€'") gives "Invalid format string "0.00 '€'" - contains mismatched quotes" because semicolon is first used to separate positive and negative parts;

    Best regards,
    Janusz

    #2
    I have tested it only a little bit but try replacing in NumberUtil.format

    Code:
    if (neg) {
        if (format.indexOf(";") != -1) {
            format = negFormat = format.substring(format.indexOf(";")+1);
        } else {
            format = format.indexOf(";") == -1 ? format : format.substring(0, format.indexOf(";"));
        }
    } else {
        format = format.indexOf(";") == -1 ? format : format.substring(0, format.indexOf(";"));
    }
    with

    Code:
    var matches = format.match(/^([^']*('.*?')*[^']*);(.*)/;
    negFormat = (matches !== null);
    format = (matches === null) ? format : matches[neg ? 3 : 1];

    Comment


      #3
      Hi,

      Any update on that?

      Best regards,
      Janusz

      Comment


        #4
        Hi,

        Thanks for noticing.
        We have fixed it.
        You can test it with next nightly build (2017-07-04).

        Comment

        Working...
        X