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

Fomatting data as currency. 1

Status
Not open for further replies.

mrdavid57

Programmer
May 10, 2001
11
US
How do I format data as currency using FrontPage 2000 as an editor while developing Active Server Pages(ASP) using an MS SQL database? When I was using an Access Database I used the "FORMAT" command. This does not work with MS SQL 7.0. Please advise.

 
Have you tried
Code:
FormatCurrency()
? As in the examples:

Code:
<%=FormatCurrency(mnyTotal)%>

<%=FormatCurrency(rs.Fields(&quot;UnitPrice&quot;).Value)%>



FormatCurrency Function

Returns an expression formatted as a currency value using the currency symbol defined in the system control panel.

FormatCurrency(Expression[,NumDigitsAfterDecimal [,IncludeLeadingDigit [,UseParensForNegativeNumbers [,GroupDigits]]]])

Arguments
Expression

Required. Expression to be formatted.

NumDigitsAfterDecimal

Optional. Numeric value indicating how many places to the right of the decimal are displayed. Default value is -1, which indicates that the computer's regional settings are used.

IncludeLeadingDigit

Optional. Tristate constant that indicates whether or not a leading zero is displayed for fractional values. See Settings section for values.

UseParensForNegativeNumbers

Optional. Tristate constant that indicates whether or not to place negative values within parentheses. See Settings section for values.

GroupDigits

Optional. Tristate constant that indicates whether or not numbers are grouped using the group delimiter specified in the computer's regional settings. See Settings section for values.

Settings
The IncludeLeadingDigit, UseParensForNegativeNumbers, and GroupDigits arguments have the following settings:
Code:
Constant            Value   Description
Code:
TristateTrue         -1     True 
TristateFalse         0     False 
TristateUseDefault   -2     Use the setting from the computer's regional settings.

You should be looking at for this kind of thing. For shame! ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top