Results 1 to 13 of 13

Thread: a dot every 3 numbers

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2004
    Posts
    70

    Resolved 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.

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: a dot every 3 numbers

    Quote 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.

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: a dot every 3 numbers


  4. #4

    Thread Starter
    Lively Member
    Join Date
    Nov 2004
    Posts
    70

    Re: a dot every 3 numbers

    Ok, any other idea?

  5. #5
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    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.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Nov 2004
    Posts
    70

    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.

  7. #7
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    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.

  8. #8
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: a dot every 3 numbers

    Something like:

    VB Code:
    1. TextBox1.Text = Format(Long.Parse(TextBox1.Text), "#,###0.00")

  9. #9
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: a dot every 3 numbers

    AAAAAAAARGGGHHHHHH

  10. #10
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    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.

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Nov 2004
    Posts
    70

    Smile 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.

  12. #12
    PowerPoster
    Join Date
    Dec 2003
    Location
    Bristol, England (but heart is in Virginia)
    Posts
    2,949

    Re: a dot every 3 numbers

    Quote 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.

  13. #13

    Thread Starter
    Lively Member
    Join Date
    Nov 2004
    Posts
    70

    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
  •  



Click Here to Expand Forum to Full Width