|
-
Apr 15th, 2004, 11:44 PM
#1
Thread Starter
New Member
how to put comma in decimal value .pls help me!!!
helo guys..i'am soo new in vb.net..i have a problem like this..how to convert decimal value like 100000 to 100,000(put comma).
before it i have used this code
.Selection.TypeText(Text:=value.ToString("N"))
but it's output is 100,000.00. so i dun want .00 include too, i want the output 100,000 only..
i hope u all out there can help me..thanks a lots
-
Apr 16th, 2004, 04:11 AM
#2
Member
Hello gigs,
if I were you I'd use the Formatnumber method to do this...
for example:
Code:
Dim i As Double = Val(TextBox1.Text)
Label1.Text = FormatNumber(i, 0, , , TriState.True)
the "0" in the FormatNumber(i, 0, , , TriState.True) method sets for 0 numbers to be shown after the decimal.
Hope that helps
-
Apr 16th, 2004, 05:47 AM
#3
Fanatic Member
VB Code:
Label1.Text = Format(Label1.Text, "##,###")
-
Apr 16th, 2004, 07:09 AM
#4
Thread Starter
New Member
thanks
thanks a lot to DEWWD and pvbangera .i will try my best..
-
Apr 16th, 2004, 09:26 PM
#5
I wonder how many charact
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
|