Re: portfolio value?
Guil Barros <[email protected]> Mon, 13 Oct 2003 16:16:10 -0500
| Newsgroups | gmane.comp.horde.jonah |
|---|---|
| Message-ID | <[email protected]> |
so here's what i have...
im only making changes to Jonah::getStockListings as it seems (to me at least)
that thats where it should go :)
how do i go about declaring a variable? i need one to hold the sum of the stock
values and for "quote[]"ing at the end. If i dont declare it somewhere i get:
Notice: Undefined variable: portfolioRunningTotal in
/usr/local/horde-cvs/horde/jonah/lib/Jonah.php on line 343
Notice: Undefined index: portfolioRunningTotal in
/usr/local/horde-cvs/horde/jonah/lib/Jonah.php on line 352
here is what i have so far:
<<<<begin
$html .= '</td><td>';
if (!empty($counts[$symbol]) && !empty($quote['lastPrice'])) {
$html .= '$' . number_format($counts[$symbol] *
$quote['lastPrice'], 2);
$portfolioRunningTotal += $counts[$symbol] *
$quote['lastPrice'];
}
$html .= '</td></tr>';
$i++;
}
/**
* Print Portfolio Value from $portfolioRunningTotal.
*/
$html .= '<tr><td>';
$html .= 'Portfolio Value:' . $quote['portfolioRunningTotal'];
$html .= '</td></tr>';
$html .= '</table>';
return $html;
>>>>end
please comment and tell me where im going wrong.
thanks,
-guil
Quoting Guil Barros <[email protected]>:
> :)
>
> anyways, trying to figure this out. seems like a good small change for me to
> make and figure out the horde/jonah layout and where to do things :)
>
> i think:
> - add it in /jonah/content.php under $showStocks right after checking for
> $tickerSymbols. Should i do the calculation right there and then echo it or
> should i calculate somewhere else and then call the function? If so, which
> file
> should i put the function in? /lib/Jonah.php seems the spot for that, but not
> entirely sure...
>
> - how does it get added into the portal page? same deal?
>
> any input would be most appreciated. Been on and off trying to learn how to
> add
> things/fix things to horde but cant seem to find any docs, et at...
>
> thx,
> -guil
>
>
> Quoting Chuck Hagenbuch <[email protected]>:
>
> > Quoting Guil Barros <[email protected]>:
> >
> > > how about an option to list your portfolio value at the bottom or the
> list
> > of
> > > stocks? maybe even graph it :)
> >
> > Sure, patch?
> >
> > ... you *knew* that was coming, didn't you? :)
> >
> > -chuck
> >
> > --
> > Charles Hagenbuch, <[email protected]>
> > Born right the first time.
> >
> > --
> > Jonah mailing list
> > Frequently Asked Questions: http://horde.org/faq/
> > To unsubscribe, mail: [email protected]
> >
>
--
Jonah mailing list
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: [email protected]
(unnamed)
(application/pgp-keys, 997 B) - not displayed