Archive

Archive for March, 2012

Display Plus(+) and Negative (-) signs before a number

If  you wish to display a plus sign in front of a numeric value for a report. perhaps to ease the reading of positive and negative values, or show an increase in an amount or value, often the negative sign will be display automatically.

You will however need to display a plus(+) sign to positive values. Or nothing at all for a zero (0) amount.

The following code will append a Plus sign to the front of positive numbers and leave a Zero as it is.

If {table.value} > 0 then

‘+’ + totext({table.value}, 0, “”)

Else if {table.value} = 0 then
totext(table.value}, 0, “”)
else

totext({table.value, 0, “”)

Categories: Crystal Reports