Report a Minus figure as brakets

Hi Folks…

Is it possible to report a minus figure

e.g -23 (which is my “Qty. on Sales Order” field) as (23) for report purposes?

I tried the following

IF number < 0 THEN
EXIT(STRSUBSTNO(’(%1)’,number)
ELSE
EXIT(FORMAT(number));

But I was getting a Void conversion error… it was expecting a Text value?? when my field is a decimal

Hmm where am I going wrong please?

do you want to show -23 as 23?

If yes, use ABS(“Qty. on Sales Order”)

Try using the FORMAT function to change your decimal to a text value.

Hi,

You can try this.

IF number < 0 THEN
EXIT(’(’+format(number)+’)’)
ELSE
EXIT(FORMAT(number));

The “VOID conversion” error is caused by the use of EXIT. I guess the function or trigger where you use it has no return value defined (void).

Hi…

Your solution was spot on…

Many Thanks

Thanks… I realised that I had not coded it within a function :frowning:

may i ask ,

Does it output

(-23) or (23) ?

Thanks.

Hi ya…

it outputs as (23)…

hope that helps geeza