Actually, it wouldn't..

The way an average is to be calculated here is to add up the balance
for each day of the month and divide by number of days in the month.

It was easy to deposit the balance on days that had deposits, it got
harder on days that didn't have deposits.. I did end up using a
cfloop.. I had a few regexes in mind, but they didn't work well.


On Wed, 16 Feb 2005 09:51:54 -0600, Greg Morphis <[EMAIL PROTECTED]> wrote:
> Tony, if someone entered a 0, wouldnt you want to account for that?
> Or if you didnt.. why not delete the 0's and then get an average (if
> they're just place holders)?
> If a 0 is just a place holder, you wouldnt want to replace it with a
> previous value. That would mess up your average.
> 
> 
> On Wed, 16 Feb 2005 10:32:28 -0500, Ben Doom <[EMAIL PROTECTED]> wrote:
> > S.Isaac pointed out that I'd misread the original post.  I thought he
> > wanted to remove them, not replace them.  That makes this just a wee bit
> > harder.  :-)
> >
> > Since what he's wanting to do is apparently average them, I'd write the
> > summation loop manually and track the last non-zero value to use in case
> > of zeros.  I'm not sure what he'd want to do with a leading zero, but
> > that's a whole new bag'o'worms.
> >
> > --Ben
> >
> > Michael Dinowitz wrote:
> > > Ben,
> > > I've tried this a few ways and I can't find any way to do a single run 
> > > RegEx
> > > which will do the job. Handling a single 0 is child's play. Handling
> > > multiple properly is not happening.
> > > If this was put in a loop, I can see it but.....
> > > What do you suggest as a solution that will handle multiple 0 replaces
> > > without a loop?
> > >
> > >
> > >>Well, you could use listdeleteat() to remove them.  That would probably
> > >>be more human readable later.  It would also handle boundary cases (ie
> > >>the first and last items) easily and cleanly.
> > >>
> > >>If, for some reason, you really want to use a regex, it certainly can be
> > >>done.  :-)
> > >>
> > >>--Ben
> > >>
> > >>Tony Hicks wrote:
> > >>
> > >>>Does anyone know if there's a way to replace an unkown number of
> > >>>consequitive 0s in a list with the previous number..
> > >>>
> > >>>For instance...
> > >>>
> > >>>147,0,119,137,0,0,0,154 would become..
> > >>>
> > >>>147,147,119,137,137,137,137,154
> > >>>
> > >>>Thanks
> > >>>Tony
> > >>>
> > >>>
> > >>
> > >>
> > >
> > >
> >
> >
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:195072
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to