|
-
Dec 3rd, 2004, 07:09 AM
#1
Thread Starter
Lively Member
a dot every 3 numbers
Hi, anyone knows how to show automatly in a text box a number with the '.' every 3 digits?. For example, the number 12000000 shown as 12.000.000
Thanks.
Last edited by nacho2; Dec 4th, 2004 at 06:42 PM.
-
Dec 3rd, 2004, 07:46 AM
#2
PowerPoster
Re: a dot every 3 numbers
 Originally Posted by nacho2
Hi, anyone knows how to show automatly in a text box a number with the '.' every 3 digits?. For example, the number 12000000 shown as 12.000.000
Thanks.
You could set your computor to the macedonian language and then format the textbox string to currency (It works!!!)
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Dec 3rd, 2004, 07:57 AM
#3
Re: a dot every 3 numbers
-
Dec 3rd, 2004, 08:12 AM
#4
Thread Starter
Lively Member
Re: a dot every 3 numbers
-
Dec 3rd, 2004, 08:22 AM
#5
PowerPoster
Re: a dot every 3 numbers
You will simply have to write code to add the "." It will, of course have to be a string and you won't even be able to get the value of it without using code to interpret it. That code would not be difficult but why do you want to do this if it is not for an unusual currency format?
Have you just gone dotty?
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Dec 3rd, 2004, 08:29 AM
#6
Thread Starter
Lively Member
Re: a dot every 3 numbers
Well actually, I don't care if it is a dot or a comma or whatever. I'm working with big numbers (always have around six zeros) and having something separating the number in groups of three would help a lot in reading it.
And yeap I need it to be a number because I need to operate with it.
Hey, thanks for your help.
-
Dec 3rd, 2004, 08:37 AM
#7
PowerPoster
Re: a dot every 3 numbers
If you are prepared to use the normal "," to separate 1000's and the "." to separate the decimals, then that is a normal VB.NET format function.
e.g.
myString = FormatNumber(myNumber, 2, , ,TriState.True)
See MSDN Help - Formatting Numbers
Last edited by taxes; Dec 3rd, 2004 at 08:40 AM.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Dec 3rd, 2004, 08:40 AM
#8
Re: a dot every 3 numbers
Something like:
VB Code:
TextBox1.Text = Format(Long.Parse(TextBox1.Text), "#,###0.00")
-
Dec 3rd, 2004, 08:41 AM
#9
Re: a dot every 3 numbers
-
Dec 3rd, 2004, 08:42 AM
#10
PowerPoster
Re: a dot every 3 numbers
Store the number in a numeric variable but display it as a string, using either my or Mendhak's approach.
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Dec 3rd, 2004, 09:02 AM
#11
Thread Starter
Lively Member
Re: a dot every 3 numbers
Ok, that's great thank you lots.
Hey, by the way, could you help me with my dataset question? It is posted in a thread titled "Trying again!!". I'm browsing the web looking for an answer but I'm getting no answer.
Thanks for your help guys.
-
Dec 3rd, 2004, 09:12 AM
#12
PowerPoster
Re: a dot every 3 numbers
 Originally Posted by nacho2
Ok, that's great thank you lots.
Hey, by the way, could you help me with my dataset question? It is posted in a thread titled "Trying again!!". I'm browsing the web looking for an answer but I'm getting no answer.
Thanks for your help guys.
Sorry. Not my forte. I thought XML was the deluxe version of my favourite Citroen car
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Dec 4th, 2004, 06:43 PM
#13
Thread Starter
Lively Member
Re: a dot every 3 numbers
Ok thank you lots anyway.
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
|