OT: Thanks!

Thomas Olsen tanghus at gmail.com
Sat Oct 17 12:00:16 CEST 2009


On 17/10-2009 11:18 John Layt <johnlayt at googlemail.com> wrote:
> On Saturday 17 October 2009 01:42:33 Thomas Olsen wrote:
> > And BTW:
> > http://www.kde-look.org/content/show.php/Currency+Converter?content=11386
> >6
> >
> > Next one tomorrow :-)

The weekend (red wine) hit me so I might wait 'till Monday ;-)

> Nice.  That reminds me I have a draft proposal to add full ISO Currency
>  Code support into KLocale, that could save you (and several others) a lot
>  of work around codes, localisation, translations, formats and rounding
>  rules.  Must get that done before feature freeze :-)  If you have any
>  input on what features you'd find useful, please let me know.

That would be great. I now have ~200 lines of code just to deal with that and 
if that could be limited to a few KLocale calls - sweet.

The class I'm currently using is a _very_ stripped down version of one I I 
found somewhere on Google Code. I accidentally deleted the link - gotta give 
the proper credits (Python lingo).

class Currency:
    code = "XXX"
    country = ""
    countries = []
    name = ""
    numeric = "999"
    symbol = None

    def __init__(self, code="", numeric="999", name="", countries=[], 
symbol=None):
        self.code = code
        self.numeric = numeric
        self.name = name
        self.countries = countries
        self.symbol = symbol

    def __repr__(self):
        return self.code

    def get_symbol(self):
        if self.symbol == None:
            return self.code
        else:
            return self.symbol


From the top of my head it would be nice to have a national flag as well. Is 
that in KLocale already?

-- 
Best Regards / Med venlig hilsen

  Thomas Olsen



More information about the Plasma-devel mailing list