Solved

Coldfusion - How to Handle Micro Currencies?

Posted on 2009-07-10
2
162 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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