Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 22nd, 2007, 10:46 PM
Authorized User
 
Join Date: Jan 2007
Location: Hawaiian Gardens, CA, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default Format Number

Hello,
I really am sorry to bother you again so soon. I am running out of time and I can not get the FornatNumber() to work correctly.

This is my code:

  fCode = oRs("Code")
        cDescription = oRs("Description")
        rPays = oRs("Remedy_Pays")


%>

    <td><%= fCode %>&nbsp;</td>
    <td><%= cDescription%>&nbsp;</td>
    <td><%= rPays%>&nbsp;</td>

I need the rPays to display a number with two decimal points.
I have tried the code below among many others and I am not getting it.
      fCode = oRs("Code")
        cDescription = oRs("Description")
        rPays = oRs("Remedy_Pays")
           rPays = FormatNumber(rPays, 2)

generates this error:
ADODB.Recordset error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.

/MD_SearchReturn.asp, line 16

I am not able to find what I need and I am getting short on time.
If you can help me I would appreciate it.
Thanks!
dink
Reply With Quote
  #2 (permalink)  
Old January 22nd, 2007, 11:00 PM
Authorized User
 
Join Date: Jan 2007
Location: , , .
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I pulled these off the web. I've used the standard one in my code wih success. This might give you a start until a guru can jump in...

Currency:
<% = Format( num, "Currency" ) %><BR>
Fixed:
<% = Format( num, "Fixed" ) %><BR>
Standard:
<% = Format( num, "Standard" ) %><BR>

generates output
Currency: $1,741,534.54
Fixed: 1741534.54
Standard: 1,741,534.54


Reply With Quote
  #3 (permalink)  
Old January 23rd, 2007, 01:40 AM
Authorized User
 
Join Date: Jan 2007
Location: Hawaiian Gardens, CA, USA.
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I tried your suggestion in the code like this:
<td><%= fCode %>&nbsp;</td>
    <td><%= cDescription%>&nbsp;</td>
    <td><% = Format( rPays, "Currency" ) %>&nbsp;</td>
and got this error message:
Microsoft VBScript runtime error '800a000d'

Type mismatch: 'Format'

/MD_SearchReturn.asp, line 52

I have pulled rPays from the db using
 rPays = oRs("Remedy_Pays")
this is the code for displaying the data on a webpage
<td><% = Format( rPays, "Currency" ) %>&nbsp;</td>
do I need create another variable? How do I get the value?

I just got it to work!!!!!
 <td><% = FormatCurrency(oRS("Remedy_Pays")) %>&nbsp;</td>
Thank you all!!!
dink
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Number format in the table zrtv SQL Server 2005 6 March 7th, 2008 03:18 AM
format-number dropping 0 stolte XSLT 1 January 18th, 2008 04:46 PM
Number Format - Need Help! bridog39 Access 7 November 14th, 2005 02:50 PM
Format Number hcweb Classic ASP Basics 4 October 27th, 2004 11:23 AM
format number tgopal Javascript 2 April 30th, 2004 03:44 AM



All times are GMT -4. The time now is 06:42 PM.


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