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
Post a Comment