Just a simple little tip this week. I wanted to format numeric data with a custom format. I wanted positive numbers to look like this relatively standard format
But I also wanted negative numbers to show up like:
With the negative sign showing to the right of the number.
At first this was a this is a bit of a problem. I figured out a way to do it using OnRender script, but it was kind of ugly. Turns out the solution is quite a bit more simple. BIRT is using the java DecimalFormat for numeric data in the CustomFormat. One of the accepted patterns for DecimalFormat is in the form of
PositivePattern ; NegativePattern
So all you need to do is select Custom Format and enter the format as (see below)
#,##0.00; #,###.00 -