Hi,
I use a stock quote script in my channels, but users complain about the anount of numbers displayed after the decimal point, like this:
<News24> » CAC: 2824.39 +52.1300011 (+1.88%)
so I'm wondering if it's possible to limit the number so it cuts it down to just 2 numbers after the . so it's more like:
<News24> » CAC: 2824.39 +52.13 (+1.88%)
Here is the portion of the script for the quotes:
proc pub:quote { nick uhost handle channel arg } {
set [lindex [info args pub:quote] 4] [string trimleft [subst $[lindex [info args pub:quote] 4]] !]
foreach _IG [uplevel #0 {set IGwords}] { if {[string equal -nocase $_IG [lindex [split $arg] 0]]} { return } }
if {[llength $arg]==0} {
putserv "NOTICE $nick :0,2 please type \002!news\002 for options "
} else {
set stock [string toupper [lindex $arg 0]]
set query "
http://finance.yahoo.com/d/quotes.csv?s ... 4mv&e=.csv"
set token [http::geturl $query]
set all [http::data $token]
regsub -all \" $all "" all
set all [split $all ","]
if {[lindex $all 2]!="0.00"} {
putserv "PRIVMSG $channel :\0037» [lindex $all 0]:\003 [lindex $all 2] \002[lindex $all 3]\002 ([lindex $all 4]) \0037 Time:\003 [lindex $all 1] USET \0037 Low-High:\003 [lindex $all 5] \0037 Volume:\003 [lindex $all 6]"
} else {
putserv "PRIVMSG $channel :\002 [lindex $all 0]\002 symbol not found"
}
}
}
The part of the quote to be shortened is: [lindex $all 3]
thanks!