[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 940
  • Last Modified:

Formatting Number with a Comma for thousands

I have 51152 coming in from a recordset.  How do I response.write that with a comma separator like 51,152?
0
sbornstein2
Asked:
sbornstein2
  • 4
  • 3
  • 2
1 Solution
 
fritz_the_blankCommented:
You should be able to do this with the formatNumber() function:

http://www.devguru.com/Technologies/vbscript/quickref/formatnumber.html

FtB
0
 
bvinsonCommented:
Try:

Response.write FormatNumber(objRS("YourField"))

bvinson
0
 
bvinsonCommented:
You could also use FormatNumber(objRS("YourField"),0) if you don't want any numbers after the decimal.  The number after the comma specifies the number of digits after the decimal.  

Here is more information:
http://www.w3schools.com/vbscript/func_formatnumber.asp

The link Fritz gave is a great reference as well...

bvinson
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
aprestoCommented:
i agree with bvison

but i think you may need to set it out like this:

Response.write FormatNumber(objRS("YourField"),0,0)

Apresto

0
 
fritz_the_blankCommented:
>>i agree with bvison<<

Hey! I was the first to suggest FormatNumber() !!!! http:#14014044


;->


FtB
0
 
bvinsonCommented:
Its true...Fritz has the quicker fingers.  I felt like I was racing him all afternoon in trying to respond to questions.  :)  He always entered his response while I was still typing mine.

bvinson
0
 
fritz_the_blankCommented:
>>He always entered his response while I was still typing mine.<<

It's callled COFFEE!!!

FtB
0
 
aprestoCommented:
lol - your right sorry ftb i think unintentianally hopped to the last comment posted

bvisons is right though, your like a machine ftb!!!

ftb - the Terminator...Ill Post Back!! :o)
0
 
fritz_the_blankCommented:
I am glad that formatNumber() worked for you. Did you not see my post then?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now