BUG: Microsoft.VisualBasic.Conversion.Val(string)
From: Daniel Moth (dmoth74_at_hotmail.com)
Date: 08/01/04
- Next message: pnp: "SelectNodes"
- Previous message: Salo: "Whats your strategy for updating your mobile app?"
- Messages sorted by: [ date ] [ thread ]
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())
- Next message: pnp: "SelectNodes"
- Previous message: Salo: "Whats your strategy for updating your mobile app?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|