BUG: Microsoft.VisualBasic.Conversion.Val(string)

From: Daniel Moth (dmoth74_at_hotmail.com)
Date: 08/01/04


Date: Sun, 1 Aug 2004 13:00:29 +0100

This appears to be fixed in CF 2.0 Beta (though not CF 1.0 SP3)

Cheers
Daniel

"Daniel Moth" <dmoth74@hotmail.com> wrote in message news:...
> Hi
>
> This is reproducible on our own 4.2 based device as well as in the
> emulator.. with SP1 or the current SP2 beta... Haven't tried on a PocketPC
> maybe someone else can please(?)
>
> When the locale is set to something like French (where decimal separators
> are commas and not dots) calling Val("23.45") throws a
> System.FormatException... Note that the same function call on the desktop
> works as expected and as documented (i.e. The Val function recognizes only
> the period (.) as a valid decimal separator)
>
> Interestingly passing "23,45" to it returns 23,00... which is correct (Val
> stops converting at the first character that cannot be interpreted as a
> numeric digit, numeric modifier, numeric punctuation, or white space.)
>
> I had a quick look with Anakrino on the desktop and cf implementations of
> Microsoft.VisualBasic.Conversion.Val(string) and they seem identical
except
> they both call HexOrOctValue which have slight differences... Any ideas?
>
> In the meantime since C# does not have an equivalent maybe someone has
> written a handy function I could use until it gets fixed...(?)
>
> Cheers
> Daniel
>
> PS In case the repro line of code was not clear just execute the
> following when the locale is set to French...
>
> MessageBox.Show(Microsoft.VisualBasic.Conversion.Val("34.3").ToString())



Relevant Pages

  • Re: locale problem
    ... > locale as well. ... > And get dates in french and error message in french for my regular user's ... and have the english messages by default. ...
    (comp.unix.solaris)
  • Re: toggle between english and french (how?)
    ... All I get are beeps when I hit the special French accent keys. ... or you have the wrong locale environment. ... and you are hearing the beeps when typing at a shell ...
    (freebsd-questions)
  • Re: toggle between english and french (how?)
    ... All I get are beeps when I hit the special French accent keys. ... characters at a shell prompt, but you have not set or configured ... any locale environment yet, or you have the wrong locale ...
    (freebsd-questions)
  • Re: toggle between english and french (how?)
    ... All I get are beeps when I hit the special French accent keys. ... characters at a shell prompt, but you have not set or configured ... any locale environment yet, or you have the wrong locale ...
    (freebsd-questions)