velocity-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Colson" <tcol...@cisco.com>
Subject RE: integer division issue
Date Tue, 06 Jan 2004 16:20:50 GMT
> > I wonder how many designers ever stopped to wonder if why:
> > 50 pix / 3 items = 16 not 16.666666666666666666666666666667 ???
> I'm wondering why you shortened it to only 23 places....  :D

With all the "What Would a calculator do?" - I Copy/Pasted from the
Windows XP Calculator and that's what it said. :-)

It sounds like most 'broken' browsers won't choke on 23 decimal places,
so Opt #1 might work in that use case, with some obvious template bloat
from the extra chars, but 


> clearly have changed [Geir] mind about FP in Velocity - [Geir] think
that 
> there is a valid use, namely comparisons :
>   #if ($account.total > $accout.limit )

Bleck! :-P

> although a purist would suggest
    #if( $account.overlimit == true)

I'd suggest even shorter, since (true == true) is redundant:
    #if ($account.overlimit) 

It is truly amazing to me how anyone would want the template to embed
business rule logic, especially when that rule may change:

Boolean show_accountlimit_warning = 
( account.isOverLimit() && ! account.isSpecial() ) 
|| 
( account.isExtremelyCloseToLimit() && account.isSpecial ) ;

I shudder at the template version... which probably has to be
search/replaced in 50 places in 18 templates!

Ugh! :-P

-Timo the Pure <grin>


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


Mime
View raw message