|
-
Dec 7th, 2000, 12:36 AM
#1
Thread Starter
Addicted Member
Hi,
Could anyone help me with formatting a string of numbers.
What I have is i have gotten a string of numbers out of a DB that looks like this say 123456789 and I would like to format them like this 123,456,789
How do I do this in vbscript, is it something like
format("#,###,###", StringName)
Any help would be great
-|- Hurgh -|-
-
Dec 7th, 2000, 12:46 AM
#2
Junior Member
dude....
I believe it would be
String = format(number,"###,###,##0")
The 0 makes sure at least a zero is printed....
-
Dec 7th, 2000, 01:07 AM
#3
New Member
Check this out..
hi,
write ur code as,
stringname = Format(stringname, "#,###,###")
Kaustav Ghosh
s/w Programmer and Developer
Engineering Division
[email protected]
Versaware Technologies (India) Pvt. Ltd.
-
Dec 7th, 2000, 10:14 AM
#4
Frenzied Member
VBScript does not support the Format function.
You will need to use the FormatNumber function which has the following syntax:
FormatNumber(Expression [,NumDigitsAfterDecimal [,IncludeLeadingDigit [,UseParensForNegativeNumbers [,GroupDigits]]]])
The last three parameters use the following:
-1 = True
0 = False
-2 = Default, Use Regional Settings.
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Dec 7th, 2000, 10:20 AM
#5
Frenzied Member
Sorry, I guess I could have also just given you an answer:
Code:
StringName = FormatNumber(StringName,0,,,-1)
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|