Wrox Programmer Forums
|
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 19th, 2004, 05:09 AM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 101
Thanks: 0
Thanked 0 Times in 0 Posts
Default geting money type from sql

hi

i am retriving value from sql server database like

select cast(round(12345674.8658,2,0) as decimal(20,2))

output is 12345674.87
but i want to get like 12,345,674.87
any function is there?

 
Old July 19th, 2004, 11:09 AM
Authorized User
 
Join Date: Jul 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can format the display by using the FormatNumber function. Its format is:

FormatNumber(value, numdigits, leadingzero, negparen, delimiter)
The 2nd, 3rd, 4th, and 5th options are tristate (-2=system default, -1=on, 0=off).

So you probably want something like this:
Response.write(FormatNumber(value, 2, 0, 0, -1))
value must be numerical data

If you want the dollar sign use FormatCurrency. Its properties are the same, except it displays the dollar sign.





Similar Threads
Thread Thread Starter Forum Replies Last Post
geting the value from an Object JAdkins Classic ASP Basics 1 June 29th, 2007 10:59 AM
rounding up SqlDbType.Money TYPE in sql server olambe BOOK: ASP.NET Website Programming Problem-Design-Solution 2 December 9th, 2005 04:46 PM
working with money values in sql server mattastic SQL Server 2000 3 September 29th, 2005 08:15 PM
geting money type from sql msrnivas .NET Web Services 1 July 19th, 2004 06:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.