Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
rounding decimal number
mh10
Hi,
i have one computed column which has values in format
12.987897456276954
i want to display them on pie chart, with 2 decemal rounding to
12.99
Any suggestions?
Thanks
Find more posts tagged with
Comments
bhanley
Hi. Sample attached which does this. Here is what I did:
1) Build out the data set
2) Create the Pie Chart
3) On the Format Chart tab of the Wizard, click on "Value Series" Then click the "Labels" button.
4) On the label configuration window, click on "Value Series" and then click the format button (a small Button right below the values selection box).
5) Format the label however you want. I chose "Standard" with a $ prefix and two decimal spots.
I also configured a tool tip to be dynamically added to this chart as well when you hover over a slice of the pir. Click the "Interactivity" button to have a look at that.
Good Luck!
mh10
Thanks bhanley........it worked<br />
<br />
<blockquote class='ipsBlockquote' data-author="bhanley"><p>Hi. Sample attached which does this. Here is what I did:<br />
<br />
1) Build out the data set <br />
2) Create the Pie Chart<br />
3) On the Format Chart tab of the Wizard, click on "Value Series" Then click the "Labels" button.<br />
4) On the label configuration window, click on "Value Series" and then click the format button (a small Button right below the values selection box).<br />
5) Format the label however you want. I chose "Standard" with a $ prefix and two decimal spots.<br />
<br />
I also configured a tool tip to be dynamically added to this chart as well when you hover over a slice of the pir. Click the "Interactivity" button to have a look at that.<br />
<br />
Good Luck!</p></blockquote>
mh10
how can i do this using any expression or any math function?<br />
from 12.347234645 to 12.35<br />
<br />
i tried Math.round(value * 100/ 100). but it is giving me whole number i.e 12<br />
<br />
<br />
Any suggestions?<br />
<br />
<br />
Thanks<br />
<br />
<blockquote class='ipsBlockquote' data-author="bhanley"><p>Hi. Sample attached which does this. Here is what I did:<br />
<br />
1) Build out the data set <br />
2) Create the Pie Chart<br />
3) On the Format Chart tab of the Wizard, click on "Value Series" Then click the "Labels" button.<br />
4) On the label configuration window, click on "Value Series" and then click the format button (a small Button right below the values selection box).<br />
5) Format the label however you want. I chose "Standard" with a $ prefix and two decimal spots.<br />
<br />
I also configured a tool tip to be dynamically added to this chart as well when you hover over a slice of the pir. Click the "Interactivity" button to have a look at that.<br />
<br />
Good Luck!</p></blockquote>
bhanley
What context are you trying to alter the display. It is a different process (only slightly) for Charts, tables and text objects.
mh10
Hi bhanley,<br />
I am trying to display these rounded numbers on Pie chart.<br />
<br />
Col1 ----> Col2 (computed )<br />
<br />
12.13642314 ---> 12.14<br />
10.24354355 ---> 10.24 <br />
7.1234312 ---> 7.12<br />
3.138543543 ----> 3.85 <br />
<br />
I want to create 'Col2 (computed )' from col1.<br />
<br />
Any suggestions?<br />
<br />
<br />
Thanks <br />
<br />
<blockquote class='ipsBlockquote' data-author="bhanley"><p>What context are you trying to alter the display. It is a different process (only slightly) for Charts, tables and text objects.</p></blockquote>
mwilliams
mh10,
Try this for the expression to your computed column:
row["col1_name"].toFixed(2);
That should do it for you. Let me know.
bhanley
You were really close. For the computed column, Javascript is the easiest way to go as formatting with masks is not available there. Try this:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>Math.round(row["VALUE"] * 100) / 100</pre>
<br />
All I did was change the order of operations for how the rounding is handled.
mh10
Thanks Michael.........toFixed(2);.....worked<br />
<br />
<br />
<br />
<blockquote class='ipsBlockquote' data-author="mwilliams"><p>mh10,<br />
<br />
Try this for the expression to your computed column:<br />
<br />
row["col1_name"].toFixed(2);<br />
<br />
That should do it for you. Let me know.</p></blockquote>
mh10
Thanks bhanley,<br />
<br />
Both ways worked<br />
<br />
Math.round(row["VALUE"] * 100) / 100<br />
row["col1_name"].toFixed(2); <br />
<br />
<br />
Appreciated.........<br />
<br />
<br />
<br />
<blockquote class='ipsBlockquote' data-author="bhanley"><p>You were really close. For the computed column, Javascript is the easiest way to go as formatting with masks is not available there. Try this:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>Math.round(row["VALUE"] * 100) / 100</pre>
<br />
All I did was change the order of operations for how the rounding is handled.</p></blockquote>
vishal44
<p>Hi All,</p>
<p> </p>
<p>I have created BIRT report using php/mysql application.</p>
<p> </p>
<p>I am using BIRT server, but when single report with huge data my BIRT server goes down and file not found issue occur.</p>
<p> </p>
<p>BIRT server using 100% CPU.</p>
<p> </p>
<p>Please reply.</p>
<p> </p>
<p>Thanks</p>
lixian123
<p>Hi ,I have exponential value example :1.70611548454e power -5 how to show on output using BIRT.Math function ?</p>