Wrox Programmer Forums
|
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 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 January 22nd, 2007, 10:46 PM
Authorized User
 
Join Date: Jan 2007
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
 
Old January 22nd, 2007, 11:00 PM
Authorized User
 
Join Date: Jan 2007
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


 
Old January 23rd, 2007, 01:40 AM
Authorized User
 
Join Date: Jan 2007
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





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





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