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

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -