February 12, 2004

locale currency info

i've been helping out a friend do a quick and dirty currency app. the bank supplying him with currency info jumped up and down on our toes by supplying currency symbols in codepage encodings (a boatload of them) rather than unicode--they were geared towards one feed per locale and made the silly codepage encoding choice based on that. this turned a reasonably simple app into a medium-sized monster thumper management one. this datafeed, i guess since i don't have a lot of experience with these, also dropped the ball on us by not supplying more info about each currency. while there is such a thing as one-half (0.50) of a dollar there is no such thing as one-half of a yen. when and where do we round? oh boy. if you read this blog with any regularity, you know what's coming ;-) another dip in the java pool under cfmx. we built a quick and dirty (but hey it works) CFC that makes use of the locale currency info contained in java.util.Currency class. you can see it in action here. i'd appreciate any feedback, note that this shouldn't be used to replace the currency formatting/parsing functions in the i18nFunction CFC. this CFC isolates the currency info for easier, specific access.


Post a Comment

<< Home