Formating numerik value as to be pozitif or negati

How can show n??meric value with MemoView by changing its DisplayFormat?
When the value pozitif the value will be like that

2.3443,33 [P]

when it s negative it will be like that

2.3443,33 [N]


and when its zero it will be like that

[Z]

Is it possible doing that with one FormatStr.

Thanks for help

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 5:28AM
    use a separate memoview left aligned turn off allow expresions
    write code in obp of band to test datafield value and place appropriate text in the second memoview.
  • edited 5:28AM
    Thank you.
  • edited 5:28AM
    I think this is not a practical solution. I expect sometihing like delphi mask
    for Display format=
    #,###.#0[P];#,###.#0[N];[Z]

    if this works it will be more smart

    %2.2n[P];%2.2n[N];[Z]

    ;) but doesnt supported.
  • edited 5:28AM
    Yes if it s supported it will be really nice.
  • edited 5:28AM
    You can also do like that

    [FormatFloat('#,###.##[P];#,###.##[N];[Z]', <frxDataSet1."anumericfieldname">)]

  • gordkgordk St.Catherines On. Canada.
    edited 5:28AM
    hi all
    Tuna is correct
    you can also alter the display format formatstring, without using the function.
    ie set display format to number select the last item it will display %2.2m
    delete this value and enter your format string without the ''s
    ie:
    #,###.##[P];#,###.##[N];[Z]
    if you want decimal places to show at all times use 0 in place of # in decimal positions
    #,###.00[P];#,###.00[N];[Z]
  • edited 5:28AM
    ;) thanks that really nice.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.