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 18:38:03 GMT
Jonathan wrote:
> So, instead of simply having:
> The price is: $price euros.
> The price is: $price euros. (${price*6.556 FFR)
> What you seem to be implying is 
> that the non-technical people who want to introduce this 
> change should have to talk to the programmers so that they expose the
constant 
> in the template. 
> For some reason, it is "bad" (TM) for them to write 6.556 
> literally in the  template.

I do not assume 'implied things' since that puts words in peoples
mouths. 

So, I will explicitly say that I personally would indeed expect a
non-technical designer to ask the Developer for this feature, rather
than hack it in directly because the template system made it possible.

"some reason": I can propose several reasons why this situation could be
bad in my opinion:
1) the conversion rate changes tomorrow to 5.998

2) each user has customized preferences for selecting her preferred
alternative currency (FFR, DM, USD, etc.)

3) the result of $price * $conversionRate will still need to have the
correct rounding and formatting for the resulting currency. (Ex. DM 6,03
or $6.03 USD - not $6.0029999987 DM)

Summary: my solution, using Velocity, would be to do this work in the
controller and give the template designer simply $price and
$preferredLocalPrice.  

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