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?
sbornstein2Asked:
Who is Participating?
 
bvinsonCommented:
Try:

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

bvinson
0
 
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:
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
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.