Better string handling. If there's a particular reason why the .upper() calls were necessary, feel free to add them in.

This commit is contained in:
Jeremy Fincher 2004-11-22 07:36:15 +00:00
parent f91a8199c7
commit a08bf6b114
1 changed files with 1 additions and 4 deletions

View File

@ -130,10 +130,7 @@ class Currency(callbacks.Privmsg):
return
conv = text.split(',')[1]
conv = number * float(conv)
resp = [str(number), curr1.upper(), '=', str(conv), curr2.upper()]
if '.' not in resp[0] and 'e' not in resp[0]:
resp[0] = '%s.00' % resp[0]
irc.reply(' '.join(resp))
irc.reply('%.2f %s = %.2f %s' % (number, curr1, conv, curr2))
yahoo = wrap(yahoo, [optional('float', 1.0), 'lowered', 'to', 'lowered'])
conf.registerPlugin('Currency')