velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Jacobson <>
Subject Re: comparing monetary value
Date Wed, 16 Oct 2002 07:44:17 GMT
STham@thoughtworks.COM wrote:

> Hi,
>    I believed at the moment, all numbers are treated as Integer. Anyone
> came across this problem of manipulating with money value before?
> Example :
>   Give a certain amount has to be less than a given value.
>    if ($someMoneyValue < 0.01) ???
> How do people normally handle money in velocity?? Thanks.

This thread, for all the heat it is generating, surely revolves around 
the separation between business logic, and presentation. If you think 
that a rigorous separation is a Good Thing, then there seems, on the 
present evidence, to be no requirement for Velocity to handle any 
numerical values other than integers. If, on the other hand, you want to 
be able to manipulate, eg, monetary values in the template, then 
'vanilla' Velocity won't work for you.

My preference is for rigorous separation - but I can think of 
circumstances where the 'quick hack' option of putting calculations, and 
numerical comparisons in the presentation layer might make sense. (But 
then, I'd use JSPs, to save myself learning Yet Another Programming 

Just my $0.02


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message