-
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 -|-
-
dude....
I believe it would be
String = format(number,"###,###,##0")
The 0 makes sure at least a zero is printed....
-
Check this out..
hi,
write ur code as,
stringname = Format(stringname, "#,###,###")
-
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.
-
Sorry, I guess I could have also just given you an answer:
Code:
StringName = FormatNumber(StringName,0,,,-1)