Flutterby™! : Numb3rs

Next unread comment / Catchup all unread comments User Account Info | Logout | XML/Pilot/etc versions | Long version (with comments) | Weblog archives | Site Map | | Browse Topics

Numb3rs

2012-04-06 19:05:51.579778+00 by meuon 4 comments

I'm getting ready to install a system in French West Africa. Getting the UTF8/Latin1 issues in the system took a day, and it's looking pretty good once I translated all the latin1 encoded translations to full UTF-8. But numbers are kicking my ass. So much of the system is accounting, and the system really really wants a decimal delimiter to be a period. Numbers. That I know of, it's the most common thing between all our societies and languages, and the french want a comma where there should be a period. So much of all of our systems want a period for the decimal and strips commas from numbers. It's going to be a long week.

[ related topics: Cryptography ]

comments in descending chronological order (reverse):

#Comment Re: made: 2012-04-10 00:23:52.801329+00 by: meuon

In my world, non-digits sometimes ARE phone numbers. BR549 is a valid phone number. Or at least, modern day equivalents are... They are all just varchars to us. What we worry about is energy and currencies.

So far, most of the input has been easy We detaint expected numerics on input specifically, and now, if lang=fr, strip periods and replace commas with periods. So far, working prety well in most cases. The last 20% will take a while.

#Comment Re: made: 2012-04-07 16:54:00.412243+00 by: other_todd

I sympathize deeply. Piddly conversion issues are why nearly all our data inputs to the massive DB that runs our lives has to be wrapped with a script, so that I can preparse data to make it palatable.

It's always something, even something as trivial as filling in a 0 in a field the user has left empty because the user (correctly) thinks the (numeric, cannot-be-null) field is not required and the DB thinks it is, and I can't casually change the structural rules of the tables.

On the one hand, this is the sort of thing that pretty much guarantees me a job forever; on the other hand, sometimes I ask myself if I really should be spending my life parsing all non-digits out of phone numbers.

#Comment Re: made: 2012-04-07 16:13:39.630311+00 by: TheSHAD0W

Meh. There are more issues with money than the decimal delimiter. IMO it's better to store amounts as integers in the smallest denomination (eg. $12.34 = 1234 cents) and only convert on output.

#Comment Re: made: 2012-04-06 20:13:44.115567+00 by: Dan Lyke

Yeah, the period vs comma thing isn't just the French vs everyone else, it's actually pretty wide-spread. And, for accounting, how many decimal points also quickly becomes an issue, and...

If it's any consolation, I'm trying to build custom sort-orders for jQuery DataTables...