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.

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.

 
If you are wanting to output the value to the screen on your ASP page from a field in your database, then you can use the formatCurrency(number, numOfDigits) vbscript function --

If you're trying to take input from the user (as in from a text box) and then insert it into a 'money' field in SQL Server, then the cdbl(variable) should suffice in making it "insertable" for the database.

Is that what you were asking?

:)
Paul Prewett
 
Thanks!

I am wanting to output the value to the screen on your ASP page from a field in your database, then you can use the formatCurrency(number, numOfDigits) vbscript function.

Would you give me an example of the code? And will it work with FrontPage 2000?


 
Thanks!

I am wanting to output the value to the screen on a ASP page from a field in my database.

Would you give me an example of the code? And will it work with FrontPage 2000?


 
And if you had a number that came from the database in a variable, say... 'amount', and I wanted to output it with a precision of 2, you would say:

response.write(formatCurrency(amount, 2))

Which, if the value in 'amount' was 17.59, the output would be:

$17.59

:)
Paul Prewett
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top