Peter,

I recall that I brought up the float issue well over 6 months ago and, after
a fair amount of discussion on the list, the idea was of making a float a
native feature was rejected.  (And as I recall, it had been brought up
previously too, with the same end result.)

There was a *huge* amount of discussion on the whitespace issue - it was so
voluminous that I can't figure out what the actual outcome was - I thought
Geir was adding some feature related to that.

The reason I raise these is to highlight that it's not that they have not
been (extensively) considered, or that they've been overlooked.  For better
or worse, they were comprehensively considered and the decision was made not
to include them.

Maybe these were decisions that should be revisited, I don't know.  But to
get an accurate fix on what's going on, I think it's important to realize
that most or all of them were deliberately addressed at some point in the
past.

The macro stuff - I don't have an opinion on.  I use them, but am OK with
what they currently do (with one exception, which I'll bring up in another
context).

A key part of the problem here, IMHO, is that Geir has shifted from being an
incredibly involved leader, to a virtually non-existent one - which is a
huge and disconcerting shift.  For whatever reason he appears to have opted
out.  I (and I'm sure many/most others) are grateful for the tremendous
effort that he put into this project.

The (Velocity) template code is only a small part of my work, and I don't
have the level of developer skill level to handle any lead role in managing
the future Velocity development.  But I'll help in any appropriate way that
I can.

Regards,

Terry

----- Original Message -----
From: "pero" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 03, 2003 1:53 PM
Subject: FW: Running total (more on: Is there a need for further
development)


Terry (and everyone else, of course :),

I think the following thread (which is currently happening
on the user list) demonstrates that there are some _basic_
things missing. This time it's the lack of Number-Support.
Such things are basicly the reason why I so often tried to
push the development or the discussion. Users can't imagine,
that their template-language would not know anything about
floats, or that #parse'd macros do not function properly or
that macros cannot be overloaded or that whitespace-handling
is so hard... If you are an experienced Velocity-User, then
you probably have written some tools to overcome some of these
"shortcommings". Velocity is good (no question) but it could
be imroved significantly. (i.e. _has to_ IMHO).

So, any suggestions on how to get the project working again?
Geir, are you still listening? What's you opinion on all that?

Peter


-----Original Message-----
From: pero [mailto:[EMAIL PROTECTED]
Sent: Monday, March 03, 2003 7:40 PM
To: 'Velocity Users List'
Subject: RE: Running total


A Tool is nothing but an Object you put into the Context. For your purpose
you could write something like:

public class MyTotal {

     private float value;

     public void add (double number) {
         this.value += number;
     }

     public float getValue() {
         return this.value;
     }
}

Then simply create an object of it and put it into your context and use it
like (assuming that you put it into the context under the
key 'amt_total'):

#foreach (...

...

   $amt_total.add($row.prior_payment_amount)

...

#end

And print the value:

$amt_total.value

Hope that helps,

Peter

..: Most people refer to the term "Tool" as a set of highly reusable
methods. There is also a Velocity-Tool-Subproject where people
put together some useful tools. Documentation (not much) can be found under:
http://jakarta.apache.org/velocity/toolsubproject.html

> -----Original Message-----
> From: Leyzerzon, Simeon G [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 03, 2003 7:26 PM
> To: 'Velocity Users List'
> Subject: RE: Running total
>
>
> Thank you, Peter
>
> What is a Tool?
>
> Is there a reference for it?
>
> Simeon
>
>
>
> -----Original Message-----
> From: pero [mailto:[EMAIL PROTECTED]
> Sent: Monday, March 03, 2003 1:23 PM
> To: 'Velocity Users List'
> Subject: RE: Running total
>
>
> Simeon,
>
> >
>
> >
>
> > The line:
>
> >
>
> >
>
> >
>
> > #set($prior_payment_amt_total = $prior_payment_amt_total +
> $row.prior_payment_amount)##
>
> >
>
>
>
> What is the type of $row.prior_payment_amount? I think it's a float or
>
> a double. If so, then you cannot do it this way since
> Velocity can only
>
> compute Integer-values (until now). So you'd have to
> calculate the total
>
> within one of your beans or you could use a Tool...
>
>
>
> Sorry for the bad news :(
>
>
>
> Peter
>
>
>
> >
>
> > Thanks.
>
> >
>
> > Simeon
>
> >
>
> > -----Original Message-----
>
> > From: pero [mailto:[EMAIL PROTECTED]
>
> > Sent: Monday, March 03, 2003 12:49 PM
>
> > To: 'Velocity Users List'
>
> > Subject: RE: Running total
>
> >
>
> >
>
> > I do not fully understand your question, but if you add an Integer
>
> >
>
> > to the context it stays an Integer unless you reassign its name
>
> >
>
> > with a String. It would be nice, if you could provide some
>
> > sample code.
>
> >
>
> >
>
> >
>
> > Peter
>
> >
>
> >
>
> >
>
> > > -----Original Message-----
>
> >
>
> > > From: Leyzerzon, Simeon G [mailto:[EMAIL PROTECTED]
>
> >
>
> > > Sent: Monday, March 03, 2003 6:46 PM
>
> >
>
> > > To: Velocity Users List (E-mail)
>
> >
>
> > > Subject: Running total
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > Is it possible to do a running total on a numeric field in
>
> >
>
> > > the velocity
>
> >
>
> > > template?
>
> >
>
> > > I'm assuming that after the merge everything is just a
>
> >
>
> > > String.  How would I
>
> >
>
> > > reconvert the numbers back to do the total?
>
> >
>
> > > Thank you.
>
> >
>
> > > Simeon
>
> >
>
> > >
>
> >
>
> > >
>
> >
> ---------------------------------------------------------------------
>
> >
>
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
>
> >
>
> > > For additional commands, e-mail:
>
> > [EMAIL PROTECTED]
>
> >
>
> > >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
> ---------------------------------------------------------------------
>
> >
>
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>
> >
>
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
>
> >
>
> >
>
> >
> ---------------------------------------------------------------------
>
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
>
> >
>
>
>
>
>
> ---------------------------------------------------------------------
>
> To unsubscribe, e-mail: [EMAIL PROTECTED]
>
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


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


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



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

Reply via email to