Solved

Coldfusion - How to Handle Micro Currencies?

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now