Forum Discussion

ZhangKun's avatar
ZhangKun
Icon for Super User rankSuper User
1 year ago
Solved

Custom number format strings

In the documentation for custom numeric format strings: However, in actual testing, it was found that the following expression would produce an unexpected result:   // 0% Number.ToText(0.4,...
  • ronrsnfld's avatar
    ronrsnfld
    1 year ago

    Sorry, missed that and learned something.

    What do you expect for output given those format strings.

     

    The second one appears correct. What would you expect for your first format string?

     

    The behavior you see is documented in the link you provided:

     

    If the number to be formatted is nonzero, but becomes zero after rounding according to the format in the first or second section, the resulting zero is formatted according to the third section.