Format Number

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2008
Posts: 1
Reputation: arunkish is an unknown quantity at this point 
Solved Threads: 0
arunkish arunkish is offline Offline
Newbie Poster

Format Number

 
0
  #1
Dec 8th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 710
Reputation: Teme64 will become famous soon enough Teme64 will become famous soon enough 
Solved Threads: 114
Teme64's Avatar
Teme64 Teme64 is offline Offline
Master Poster

Re: Format Number

 
0
  #2
Dec 8th, 2008
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#.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 1
Reputation: penguinruwan is an unknown quantity at this point 
Solved Threads: 0
penguinruwan penguinruwan is offline Offline
Newbie Poster

Re: Format Number

 
0
  #3
Dec 16th, 2008
Originally Posted by arunkish View 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.
Try this
Format(yourNo, "#,##0")
all the best
Last edited by penguinruwan; Dec 16th, 2008 at 2:03 am.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 144
Reputation: sierrainfo is an unknown quantity at this point 
Solved Threads: 9
sierrainfo sierrainfo is offline Offline
Junior Poster

Re: Format Number

 
0
  #4
Dec 17th, 2008
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC