Jacob Rael wrote: > Just a newbie, trolling. > > I like this solution. Simple, easy to understand. > > Did you put the SI_prefixes outside the def so you could wrap the > whole thing in a module and reuse it in other blocks?
Do "import dis" and then try "dis.dis(myfloat)" on Fredrik's version and on your suggested variation... (Hint, it's likely more an instinct for decent performance instead of an instinct for decent portability, though it would serve both purposes.) -Peter -- http://mail.python.org/mailman/listinfo/python-list