velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominik Bruhn <domi...@dbruhn.de>
Subject Double-Calculations in Velocity
Date Wed, 03 May 2006 13:06:30 GMT
Hy,
I wrote this macro:
=====
#macro ( pollbar $total $part $maxwidth $color )
	#set($pc=$part/$total)
	#set ($nw=$pc*$maxwidth)
	<img src="/images/poll/color${color}.gif" width="$nw" height="5" xxx="$pc" />
#end
=====

For some values this works but for the most $nw is 0 afterwards because $pc is 
0. Is this my mistake or is velocity unable to calc in double or float?

Thanks
TO

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message