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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

formatting output of currency field 1

Status
Not open for further replies.

leadman

Programmer
Jun 11, 2001
177
US
Hi,
In outputting a currency type field in my Access database Im having some trouble. A value that looks like $5.00 in Access looks like 5.0000 on my page when i output it. Any ideas? (in access ive set the decimal places to 2)
 
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;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top