943,734 Members | Top Members by Rank

Ad:
  • VB.NET Discussion Thread
  • Unsolved
  • Views: 9840
  • VB.NET RSS
Dec 8th, 2008
0

Format Number

Expand Post »
Hi All,
Hope I'm now at the right place. Well.... I have a numeric field and I want to format the field as follows in the select statement. How should I do it??

For eg.
9000 - 9,000
10000 - 10,000
120200 - 1,20,200
etc....
Simply an indian format. How is that possible?

Thanks in advance.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
arunkish is offline Offline
1 posts
since Dec 2008
Dec 8th, 2008
0

Re: Format Number

It seems that .NET does not support Indian formatting for some reason. You have to implement formatting yourself, for example write your own (overloaded) ToString method. Shouldn't be that hard to write code for this.

I did find a one .NET implementation for this (both numbers and dates Indian Number & Date format, but the source code is in C#.
Reputation Points: 218
Solved Threads: 201
Veteran Poster
Teme64 is offline Offline
1,024 posts
since Aug 2008
Dec 16th, 2008
0

Re: Format Number

Click to Expand / Collapse  Quote originally posted by arunkish ...
Hi All,
Hope I'm now at the right place. Well.... I have a numeric field and I want to format the field as follows in the select statement. How should I do it??

For eg.
9000 - 9,000
10000 - 10,000
120200 - 1,20,200
etc....
Simply an indian format. How is that possible?

Thanks in advance.
Try this
Format(yourNo, "#,##0")
all the best
Last edited by penguinruwan; Dec 16th, 2008 at 2:03 am.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
penguinruwan is offline Offline
1 posts
since Jan 2007
Dec 17th, 2008
0

Re: Format Number

Try this :
Go to Control Panel >>>> Regional Options >>> Numbers and change the "Digit Grouping" like 12,34,56,789 then OK


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Label1.Text = Format(Your No., "##,##0")
End Sub
Last edited by sierrainfo; Dec 17th, 2008 at 8:32 am.
Reputation Points: 10
Solved Threads: 9
Junior Poster
sierrainfo is offline Offline
144 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in VB.NET Forum Timeline: Data from datatable after datagrid sorting
Next Thread in VB.NET Forum Timeline: to stop window minimization automatically





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC