Converting foreign numeric conventions to US

PoulsenL at capanalysis.com PoulsenL at capanalysis.com
Thu Aug 14 15:39:30 CEST 2003


I have a number of text fields with different ways of exressing currency.
Examples:

1 512,3 M
0.214,0 m
1 123 k
1,234,567
1.235.458,90
1,234,324 m (Where in this case m is to be conveyed as k.  My only check is
to look at the final number and adjust by /1000 if greater than say 1
billion)
12,456 M [Tab] 67,897 k (where these numbers represent two different
scenarios)
1) [Tab] 0.456,9 M [CR] 2) [Tab] 45.879,0 M (where these numbers represent
two different scenarios)

plus a few other creative ways to express currency.  I have written a re
that covers each case and, using matched groups, puts things back together
using the US convention but I was hoping for a cleaner more pythonic (read:
more readable) solution.

Thanks in advance,

Loren
--------------------------------------------------------------------------------------------------------------------
This email and any attachments contain information from CapAnalysis, LLC, which may be confidential and/or privileged. The information is intended to be for the use of the individual or entity named on this email. If you are not the intended recipient, be aware that any disclosure, copying, distribution or use of the contents of this email is prohibited. If you receive this email in error, please notify us by reply email immediately so that we can arrange for the retrieval of the original documents at no cost to you.





More information about the Python-list mailing list