Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to Format a Number in Classic ASP

Posted on 2008-10-03
5
Medium Priority
?
2,634 Views
Last Modified: 2010-04-21
Hello,

In a Classic ASP application I have a value in a variable that contains a number in bytes (example 2389977645).  I want to display it so as it uses commas.  I have found the FormatNumber() function useless in this area.

Example preferred output: 2,389,977,645

What can you recommend?

Thanks,

Michael
0
Comment
Question by:michael4606
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 22634470
vbscript or jscript?
0
 
LVL 82

Accepted Solution

by:
hielo earned 260 total points
ID: 22634493
I just tried:
Response.Write( FormatNumber("2389977645",0))

and it works.
0
 
LVL 39

Assisted Solution

by:BrandonGalderisi
BrandonGalderisi earned 120 total points
ID: 22634500
This:

wscript.echo formatnumber ("12345",0)

produces 12,345 for me

What does it do for you?

Here's a reference for the command.  You may have to override some regional settings:
http://www.w3schools.com/vbscript/func_formatnumber.asp
0
 
LVL 7

Assisted Solution

by:Brad Dobyns, CSM
Brad Dobyns, CSM earned 120 total points
ID: 22634502
It depends on your regional settings but that should work:
<%= FormatNumber(myNumber,0) %>

Open in new window

0
 

Author Closing Comment

by:michael4606
ID: 31502775
Thanks guys it was my error using the function wrong.  You set me straight.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Debug Tools to analyse IIS process: This article focus on taking memory dumps from IIS to determine which code is taking more time and to analyse which calls hangs/causes more CPU usage. To take dumps,download the following. Install1: To st…
Prologue It is often required to host multiple websites on a single instance of IIS, mostly in development environments instead of on production servers. I am sure it is not much a preferred solution on production servers but this is at least a pos…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question