Results 1 to 3 of 3

Thread: VAL to convert thousands...

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2001
    Location
    Buffalo, NY
    Posts
    297

    VAL to convert thousands...

    Hello,

    I'm using VAL to convert some strings into numbers, and it would appear that MS has once again implemented stupidity at the lowest level.

    VAL is converting "3,000.00" to 3.0, or "6,150.00" to 6.0. In other words, since comma is not a valid number it's stopping right there. Completely ignoring the fact that a comma is a valid part of a number string in those crazy little countries like America.

    Any ideas? I do NOT want to go through and put a freaking Replace() funciton everywhere in my code I use VAL.

    Thanks,

    Ben

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

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

    int32.Parse, and also System.Convert

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