Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Number formatting in BIRT 2.3.1
Number formatting in BIRT 2.3.1 [message #551885] Mon, 09 August 2010 20:17 Go to next message
Amit Bhargava is currently offline Amit Bhargava
Messages: 4
Registered: August 2010
Junior Member
Hi all,

Am trying to get some numeric data in the following format

##,##,###.00

In other words, the 3 least significant digits need to be together and grouping is of every 2 digits after that.

eg: 12,12,223.45

Is this possible using custom number formatting in BIRT 2.3.1?
Re: Number formatting in BIRT 2.3.1 [message #552009 is a reply to message #551885] Tue, 10 August 2010 10:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

BIRT has number formatting and can also call java classes if you want to
do something different than the default. I tried with the pattern you
posted and it did not come out like you needed. Can you produce what
you need with Java number formatting?

Jason

On 8/9/2010 8:17 PM, Amit Bhargava wrote:
> Hi all,
>
> Am trying to get some numeric data in the following format
>
> ##,##,###.00
> In other words, the 3 least significant digits need to be together and
> grouping is of every 2 digits after that.
> eg: 12,12,223.45
>
> Is this possible using custom number formatting in BIRT 2.3.1?
Re: Number formatting in BIRT 2.3.1 [message #552642 is a reply to message #552009] Thu, 12 August 2010 22:39 Go to previous messageGo to next message
Amit Bhargava is currently offline Amit Bhargava
Messages: 4
Registered: August 2010
Junior Member
Thanks for the reply, Jason. It turned out the normal formatting was sufficient for our purposes.

Just in case, could you please give me an example of how a custom Java class would be called to provide formatting?

Thanks
Re: Number formatting in BIRT 2.3.1 [message #552819 is a reply to message #552642] Fri, 13 August 2010 11:59 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
Messages: 9167
Registered: July 2009
Senior Member

You can import any class that is in the classpath. For example suppose
I wanted to format dates a different way. I could do this in script or
an expression like:

var mydt1 =params["date1"].value
var mydt2 =params["date2"].value

importPackage( Packages.java.text );
var sdf = new SimpleDateFormat("MMM d, yyyy");
var mydtf1 = sdf.format( mydt1 );
var mydtf2 = sdf.format( mydt2 );
mydtf1 + "-" + mydtf2

Jason

On 8/12/2010 10:39 PM, Amit Bhargava wrote:
> Thanks for the reply, Jason. It turned out the normal formatting was
> sufficient for our purposes.
> Just in case, could you please give me an example of how a custom Java
> class would be called to provide formatting?
>
> Thanks
Previous Topic:default value of report parameter
Next Topic:Multiple Charts on a Canvas
Goto Forum:
  


Current Time: Sat Aug 23 13:35:42 EDT 2014

Powered by FUDForum. Page generated in 0.01642 seconds