Solved

Coldfusion - How to Handle Micro Currencies?

Posted on 2009-07-10
2
157 Views
Last Modified: 2013-12-24
I couldn't find a single topic on this anywhere, unusually.

Here's the problem - I have an XML file I need to parse, and the 'cost' data is reported in (what I've discovered to be) 'Micro Currency'.  For example, what it actually 81p is shown in the XML as 810000, and likewise £66.87 is shown as 66870000.

As this is the only XML (of several) reporting in this way, I need to convert the values into the 'normal' format (i.e 0.81 & 66.87 using the examples above).

As far as I can tell, CF itself doesn't have anything built in to deal with this.  What would be the most effective way of handling it, before doing a cfquery insert?
0
Comment
Question by:Reveroom
2 Comments
 
LVL 13

Accepted Solution

by:
srikanthmadishetti earned 500 total points
ID: 24822479
Try to do some thing like this

<cfoutput>


#DecimalFormat(66870000/1000000)#

#DecimalFormat(810000/1000000)#
</cfoutput>

if you want to display in local curreny format.

try to see this

LSEuroCurrencyFormat, LSIsCurrency, LSParseCurrency, LSParseEuroCurrency, SetLocale
0
 

Author Comment

by:Reveroom
ID: 24822492
Perfect!

Thanks for the quick help - much appreciated! :-)
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question