Zero values not obeying style

(4 posts) (2 voices)
  1. dharkness, Member

    We have a simple two-decimal percentage style called "Percent"

    %.2f %

    which works fine for positive values such as

    13.72 %
    2.65 %
    0.01 %

    However, zero values are showing without the trailing %, e.g.

    0.00

    First I tried adding a zero format to the style

    %.2f %; %.2f %

    but that didn't change anything.

    I had to change "%.2f" to a hard-coded "0.00" display value *and* double the %:

    %.2f %; 0.00 %%

    Now it displays correctly as

    0.00 %

    Why doesn't the original style work with a zero value given that zero values are optional? It's like MyDBR refuses to send zero values to sprintf() at all.

  2. myDBR Team, Key Master

    Zero value (like nagetive value) has it's own formatting. If you do not specify a format, default formatting is used. You can repeat the same format as used in the positive.

    --
    myDBR Team

  3. dharkness, Member

    Zero value (like negative value) has it's own formatting. If you do not specify a format, default formatting is used.

    The lack of a zero-specific format should cause MyDBR to use positive format (same for negative)--not revert to using the built-in, default format. This would match the behavior of Excel and other systems that have positive/zero/negative formats.

    You can repeat the same format as used in the positive.

    That works, but I think the above is more intuitive.

  4. myDBR Team, Key Master

    This behavior is changed in the latest build.

    --
    myDBR Team


Reply

You must log in to post.