Formatting a number

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there an easy way to format a number in a Database Results Table? For
example, I'd like 94.6666667 to display 'rounded' as 95.
 
No easy way. You should be able to do it with ASP when you extract the
number from the Database.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.

-----Original Message-----
From: David Carpenter [mailto:D[email protected]]
Posted At: 06. august 2004 01:15
Posted To: microsoft.public.frontpage.client
Conversation: Formatting a number
Subject: Formatting a number


Is there an easy way to format a number in a Database Results Table?
For example, I'd like 94.6666667 to display 'rounded' as 95.
 
<%=FormatNumber(recordset("fieldname"),0)%>

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 
Hi David,

One of two methods:

1. Change the output of the of the results to use VB script
<% =FormatNumber(FP_RS("fieldname"),2) %>

2. Use a custom SQL query string

SELECT FormatNumber([Sales],0) AS Amount
FROM orders;
 
Mike could you reply with a sample sql for. I have multiple calculations in
the query and would like to format them to only one decimal place.

MD Websunlimited said:
Hi David,

One of two methods:

1. Change the output of the of the results to use VB script
<% =FormatNumber(FP_RS("fieldname"),2) %>

2. Use a custom SQL query string

SELECT FormatNumber([Sales],0) AS Amount
FROM orders;
--
Mike -- FrontPage MVP '97-'02
J-Bots 2004 Released Special Pricing
http://www.websunlimited.com
FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible


David Carpenter said:
Is there an easy way to format a number in a Database Results Table? For
example, I'd like 94.6666667 to display 'rounded' as 95.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top