How to get decimal values rouded to two

0

In my Japer report when Im using  $F{value}.doubleValue() which results  10.0
Now the Requirement is to display 10.00.
What should I use to get 10..0 rather than 10.0 |

Thanks.

santosh.audi19's picture
Joined: Sep 9 2015 - 9:58am
Last seen: 10 months 1 week ago

3 Answers:

0

You can use pattern option. Go textfields properties. Under text field section you will see the pattern. 

zh3ntil's picture
533
Joined: Nov 19 2014 - 11:02pm
Last seen: 5 years 6 months ago
0

what would be the proper method to insert the formatting in the expression editor.

sspecifically becuase one wants to mix both a formatted number and a formattted date in the same text field box?

Thanks

beekerc69's picture
Joined: Mar 6 2015 - 9:38pm
Last seen: 4 years 10 months ago
0
 
Formatting in expression editor:
 
     number format example:
     new java.text.DecimalFormat("#,###.00").format($F{price})
 
     date format example:
     new java.text.SimpleDateFormat("dd/MM/yyyy").format($F{date})
 
you can check the java expressions for others.
zh3ntil's picture
533
Joined: Nov 19 2014 - 11:02pm
Last seen: 5 years 6 months ago
Feedback
randomness