velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Revusky <revu...@wanadoo.es>
Subject Re: comparing monetary value
Date Wed, 16 Oct 2002 13:01:55 GMT
On Wednesday 16 October 2002 01:51 am, Tim Colson wrote:
> 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}

You do seem to be deliberately missing the point. You can choose 
$preferredLocalPrice because you're a java programmer and you can put hte 
necessary logic in the back end. Someone working on the template level cannot 
do that. OTOH, they can write foo*1.234.


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

Well.... excuse me.... To say that Velocity provides a solution, which is to 
write your own tool, just seems like double-talk to me. It is almost akin to 
proposing that the solution to the lack of floating point numbers is in fact 
not to use floating point numbers.

The fact remains that Velocity (and this may be by neglect, or by conscious 
choice) simply does not address the issue. To say that somebody has the means 
to provide a custom solution is not the same as saying that Velocity provides 
a solution. It simply does not. Velocity simply does not provide a solution 
for the localized (or even non-localized) display of decimal numbers. Whether 
it should do so is open to debate, but it mostly clearly does not address the 
issue.

>
> > There is one BIG mistake in this reasoning.
>
> It's not a mistake, it's my opinion, to which I feel entitled to have.

Tim, it follows logically that what you are expressing is your opinion. (I 
take that as a given.) It also follows logically that you are entitled to 
have that opinion. (I don't question that either.) But it does not follow 
from there that the opinion in question is not mistaken. Or based on mistaken 
reasoning... (though in that case, you'd still be entitled to hold said 
opinion... :-)

<sigh>

> 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.

Well, I think that is quite a valid point. If you want features that Velocity 
does not have, you should try something else that has those features. 
Particularly given the culture here, it does not seem that waiting for the 
Velocity developers to implement the desired feature is likely to be 
fruitful.

>
> > 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.

Well, it's good that you're happy. Personally, I would find limiting myself to 
such a small feature set to be too restrictive. But it's up to everybody to 
assess their options and make their own decisions. (To recap, it's their 
decision, they're entitled to make it, and it may or may not be mistaken....) 
That much seems clear.

Regards,

Jonathan Revusky
--
FreeMarker-Velocity comparison doc
http://freemarker.sourceforge.net/fmVsVel.html
Velocity->FreeMarker template conversion utility
http://freemarker.sourceforge.net/usCavalry.html


--
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