Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Format number depending on the row value
Format number depending on the row value [message #658464] Tue, 08 March 2011 09:51 Go to next message
Nicola is currently offline Nicola
Messages: 184
Registered: July 2009
Senior Member
Hi,
I have a need for formatting a number with N decimal after the comma
depending on the value of another filed in the datarows.
How can I do that=?
I use birt viewer 2.6.0.
Thank you,

Bye
Nicola
Re: Format number depending on the row value [message #658465 is a reply to message #658464] Tue, 08 March 2011 10:08 Go to previous message
Nicola is currently offline Nicola
Messages: 184
Registered: July 2009
Senior Member
Hi,
I found the solution.
Javascript:

importPackage( Packages.java.text );
var df = new DecimalFormat();
df.setMaximumFractionDigits(4);
df.setMinimumFractionDigits(2);
...... write logic.....


Bye
Nicola


nicola ha scritto:
> Hi,
> I have a need for formatting a number with N decimal after the comma
> depending on the value of another filed in the datarows.
> How can I do that=?
> I use birt viewer 2.6.0.
> Thank you,
>
> Bye
> Nicola
Previous Topic:Automatically extracted BIRT FAQs
Next Topic:Problem importing BIRT code in GWT application
Goto Forum:
  


Current Time: Tue Jul 29 16:55:10 EDT 2014

Powered by FUDForum. Page generated in 0.03036 seconds