Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Coldfusion - How to Handle Micro Currencies?

Posted on 2009-07-10
2
Medium Priority
?
172 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 2000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Loops Section Overview

824 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