3 Questions:

1) We have been using velocity 1.3.1-rc2 and have a requirement where we
need to compare floats in velocity templates.  So we need to do
something like

 #set($afloat=$floatObject.gpa)

 #set($gpaWarning = 2.7)

 #if ($afloat <= $gpaWarning)

academic probation letter....

 

Can this be done in 1.5-dev?  If we need to put the gpaWarning value
into context, we can do that if it cannot be declared in the template.
Is that needed? 

 

2) We have quite a bit of code that depends on 1.3.1-rc2, is 1.5-dev in
a stable state? 

 

3) What is the URL to get the Velocity 1.5-dev version? 

 

--------------------------------------------------

The unreleased Velocity 1.5-dev (grab the nightly snapshot of the source


code) handles floats and all other number types.

 

Best,

WILL

 

----- Original Message ----- 

From: "Peter Harrison" <[EMAIL PROTECTED]>

To: "Velocity Users List" <[email protected]>

Sent: Tuesday, May 03, 2005 1:52 PM

Subject: Re: How to compare float number

 

 

> On Wednesday 04 May 2005 03:47, jill han wrote:

>> I tried to compare a  float number to a certain value like:

>> #set($afloat=$floatObject.float)

>> #set($count = 0)

>> #if ($afloat >= 4)

>> #set($count = $count + 1)

>> #end

>>

>> But it was always evaluated as false, $count is always 0.

>

> Velocity doesn't deal with floats. I think velocity tools might have a


> class

> for float math which you can add to the context for doing math.

>

> We developed our own math class along with date, comparitor and other 

> classes

> for dealing with these types of thing. I can probably post a link tot
he 

> code

> at some point.

>

>

> -- 

> Peter Harrison

> Managing Director

> Nothing But Net Limited

>

> ---------------------------------------------------------------------

> To unsubscribe, e-mail: [EMAIL PROTECTED]

> For additional commands, e-mail: [EMAIL PROTECTED]

> 

 

 

Sincerely,
Nick Skriloff, ME, MCP
Information Technology Specialist
Darden Information Services
Voice 434 243 5025  Fax 434 982 2741
[EMAIL PROTECTED]

 

Reply via email to