Converting foreign numeric conventions to US

P

PoulsenL

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top