Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Euro Currency Format function

Status
Not open for further replies.

bluetang

Technical User
Apr 10, 2001
14
DE
Hi,

Please excuse the dumb newbie question but I need some help.

I need to format my code so that the values are all shown in £xx,xxx.xx format and I can't figure out how.

At the moment:
Code:
         <cfoutput><i>#RTPValue#</i></cfoutput>
is outputting the unformatted value ok.

Any suggestions gratefully accepted :eek:)
 
Dollarformat

Returns number as a string formatted with two decimal places, thousands separator, and dollar sign. Parentheses are used if number is negative. Dollarformat returns strings in the U.S. dollar format.

Syntax
Dollarformat(number)

number
Number being formatted.

Examples
<!--- This example shows the use of Dollarformat --->
<HTML>
<HEAD>
<TITLE>
Dollarformat Example
</TITLE>
</HEAD>

<BODY BGCOLOR=silver>
<H3>Dollarformat Example</H3>

<CFLOOP from=8 to=50 index=counter>
<CFSET full = counter>
<CFSET quarter = Evaluate(counter + (1/4))>
<CFSET half = Evaluate(counter + (1/2))>
<CFSET threefourth = Evaluate(counter + (3/4))>
<CFOUTPUT>
<PRE>
bill #Dollarformat(full)# #Dollarformat(quarter)#
#Dollarformat(half)# #Dollarformat(threefourth)#
18% tip #Dollarformat(Evaluate(full * (18/100)))#
#Dollarformat(Evaluate(quarter * (18/100)))#
#Dollarformat(Evaluate(half * (18/100)))#
#Dollarformat(Evaluate(threefourth * (18/100)))#
</PRE>
</CFOUTPUT>
</CFLOOP>

</BODY>
</HTML>

:) Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
Hi,

Thanks for the prompt reply. That's great, but how could I get the values to show in GBP (£)?

Many thanks again :)
 
ColdFusion have a function called LSEuroCurrencyFormat():
LSEuroCurrencyFormat that returns a currency value using the convention of the locale and the Euro as the currency symbol. Default value is &quot;local.&quot;

Note The locale is set with the SetLocale function.

See, also, LSParseEuroCurrency, LSCurrencyFormat, and SetLocale.

Syntax
LSEuroCurrencyFormat(currency-number [, type ])

currency-number
The currency value.

type
Currency type. Valid arguments are:

none -- (For example, 10.00)
local -- (Default. For example, 10.00 €)
international -- (For example, EUR10.00)
Usage
The LSEuroCurrencyFormat function can display the Euro symbol (€) only on Euro-enabled computers, such as Windows NT 4.0 SP4, that have Euro-enabled fonts installed.

This function is similar to LSCurrencyFormat except that LSEuroCurrencyFormat displays the Euro currency symbol (€) or the international Euro sign (EUR) if you specify the type as local or international, respectively, and the Euro is the accepted currency of the locale.

Currency output
The following table shows sample currency output for some of the locales supported by ColdFusion in each of the format types: local, international, and none.


Currency Output by Locale
Locale Format Type Output
Dutch (Belgian) Local: 100.000,00 €
International: EUR100.000,00
None: 100.000,00


Dutch (Standard) Local: € 100.000,00
International: EUR100.000,00
None: 100.000,00


English (Australian) Local: €100,000.00
International: EUR100,000.00
None: 100,000.00


English (Canadian) Local: €100,000.00
International: EUR100,000.00
None: 100,000.00


English (New Zealand) Local: €100,000.00
International: EUR100,000.00
None: 100,000.00


English (UK) Local: €100,000.00
International: EUR100,000.00
None: 100,000.00


English (US) Local: €100,000.00
International: EUR100,000.00
None: 100,000.00


French (Belgian) Local: 100.000,00 €
International: EUR100.000,00
None: 100.000,00


French (Canadian) Local: 100 000,00 €
International: EUR100 000,00
None: 100 000,00


French (Standard) Local: 100 000,00 €
International: EUR100 000,00
None: 100 000,00


French (Swiss) Local: € 100'000.00
International: EUR100'000.00
None: 100'000.00


German (Austrian) Local: € 100.000,00
International: EUR100.000,00
None: 100.000,00


German (Standard) Local: 100.000,00 €
International: EUR100.000,00
None: 100.000,00


German (Swiss) Local: € 100'000.00
International: EUR100'000.00
None: 100'000.00


Italian (Standard) Local: € 10.000.000
International: EUR10.000.000
None: 10.000.000


Italian (Swiss) Local: € 100'000.00
International: EUR100'000.00
None: 100'000.00


Norwegian (Bokmal) Local: € 100 000,00
International: EUR100 000,00
None: 100 000,00


Norwegian (Nynorsk) Local: € 100 000,00
International: EUR100 000,00
None: 100 000,00


Portuguese (Brazilian) Local: €100.000,00
International: EUR100.000,00
None: 100.000,00


Portuguese (Standard) Local: €100.000,00
International: EUR100.000,00
None: 100.000,00


Spanish (Mexican) Local: €100,000.00
International: EUR100,000.00
None: 100,000.00


Spanish (Modern) Local: 10.000.000 €
International: EUR10.000.000
None: 10.000.000


Spanish (Standard) Local: 10.000.000 €
International: EUR10.000.000
None: 10.000.000


Swedish Local: 100.000,00 €
International: EUR100.000,00
None: 100.000,00


Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
Thanks very much for your help.

Kindest regards
Sara
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top