Number formatting

G

Guest

Hi Y'all'

I have a small problem with formatting and not sure if it's FP or SQL that
is causing the problem.

I have .asp pages that are getting information form either SQL tables or
views. The only problem is I have no formatting therefore on the .asp page
large numbers just appear as 1 number i.e. 123456 when I want it to appear
123,456 etc.

Does that make any sense? I really would appreciate any pointer on this as
I am being asked to provide these type of webpages more & more

Tia,


Jonathan
 
K

Kevin Spencer

Use the VBScript FormatNumber() function:

FormatNumber(Expression [,NumDigitsAfterDecimal [,IncludeLeadingDigit
[,UseParensForNegativeNumbers [,GroupDigits]]]])

The parameters are all optional, except for the "Expression" parameter,
which is the numeric value to be formatted.

NumDigitsAfterDecimal - Number of digits to display after the decimal point.
Default is -1, which is to use the computer's regional settings

IncludeLeadingDigit - TriState value indicating whether a leading zero is
used with fractional values

UseParensForNegativeNumbers - TriState value indicating whether or not to
enclose negative numbers in parentheses.

GroupDigits- TriState value indicating whether or not to group digits using
the group delimiter specified in Control Panel.

TriState:

-1 = TriStateTrue
0 = TriStateFalse
-2 = TriStateUseDefault

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.
 
T

Thomas A. Rowe

You have to use ASP to format the numbers, not a FP issue.

<%=FormatNumber(rs("rates"))%>

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

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

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

Top