Solved

Coldfusion - How to Handle Micro Currencies?

Posted on 2009-07-10
2
167 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

Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

Question has a verified solution.

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

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

630 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