|
-
Apr 16th, 2004, 03:44 AM
#1
Thread Starter
New Member
How to Place Values Containing Commas in integer
helo guys, i am so new in VB.net..now i have a problems..i have sent before it but have no reply..so my problem is how to place the values containing commas when i print it, example
in my database =100000 but when i print i want 100,000
before it i have use this code
.Selection.TypeText(Text:=Cert.ToString("N"))
but the output when i print is 100,000.00. so i dun want .00 come out. i hope anyelse out there can give me the solution..tq a lots
-
Apr 16th, 2004, 06:41 AM
#2
ALl you have to do is select what you want out of the string:
VB Code:
Dim num As String = "100,000,000.00"
num = Microsoft.VisualBasic.Left(num, Len(num)-2)
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Apr 16th, 2004, 09:25 PM
#3
I wonder how many charact
"in my database =100000 but when i print i want 100,000"
Then use the .Format method of the .Net String class.
VB Code:
Dim s As Decimal = 10330000.15D
MessageBox.Show(String.Format("{0:#,###}", s))
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
|