velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Colson" <tcol...@cisco.com>
Subject RE: comparing monetary value
Date Tue, 15 Oct 2002 23:51:16 GMT
Daniel 

> Well, this is a MVC View tool, right? The formatting is the task of
> the view component (Velocity). So it should give a solution to do the
> formatting. Something like ${foo*1.234|0.00}.

Obviously, opinions will differ. For me, Velocity suits just fine
because I choose to do this: $preferredLocalPrice instead of
${foo*1.234|0.00} 

But to the point that [velocity] should give a solution. It does. Write
a tool. Drop it into the context. Done. 

> There is one BIG mistake in this reasoning. 
It's not a mistake, it's my opinion, to which I feel entitled to have.
And I choose to use Velocity as it stands because it solves my needs. If
it isn't a good fit for your problem, may I suggest trying or writing
something else.  

> Basically you said here
> that if the designer uses decimals, then he probably does the task of
> the programmers, also probably he will do something silly. 
>... It is IMO not a valid argument that Velocity
> doesn't support decimals because it may allow designer to do something
> that is not his/her task. With this logic, Velocity should not support
> #if, because the designer perhaps will do something silly with that...

I suggested no such thing(s), please don't put words into my mouth. 

What I suggested was an alternative solution that can be carried out
with the released version of Velocity. I did not speculate why floats
are not handled.

Actually, in the past, I have asked why all number types aren't treated
the same. The reality is that for whatever reason, Velocity doesn't work
that way. So I could either stop whining and work with what's there,
choose a different template engine, or write my own. I decided it really
wasn't a big deal, and in fact, now I don't even use the integer
comparison in my templates and I'm happy. 

Tim


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


Mime
View raw message