string - Java:jasper report remove trailing zeros -


i have report have used floor function result result gives out decimals 2.0 , want whole number 2.

this formula used result.

floor(days(date(new integer($f{date_last_modified}.getyear()+1900),new integer($f{date_last_modified}.getmonth()+1),new integer($f{date_last_modified}.getdate())),date(2013,05,20))/7)+" "+"weeks "+days(date(new integer($f{date_last_modified}.getyear()+1900),new integer($f{date_last_modified}.getmonth()+1),new integer($f{date_last_modified}.getdate())),date(2013,05,20) ) % 7 +" "+"days"+" ago"  

just cast formula integer

(int) yourformula  

then formula code

(int) (floor(days(date(new integer($f{date_last_modified}.getyear()+1900),new integer($f{date_last_modified}.getmonth()+1),new integer($f{date_last_modified}.getdate())),date(2013,05,20))/7)+" "+"weeks "+days(date(new integer($f{date_last_modified}.getyear()+1900),new integer($f{date_last_modified}.getmonth()+1),new integer($f{date_last_modified}.getdate())),date(2013,05,20) ) % 7 +" "+"days"+" ago") 

Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -