Re: Strange behaviour of Str$



"Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in
news:OUxFBlKpFHA.2916@xxxxxxxxxxxxxxxxxxxx:

> "John Carlyle-Clarke" <john.cc@xxxxxxxxxxxxxxxxxxxxxxx> wrote in
> message news:Xns96B76676367CCjohncceuroplacercouk@xxxxxxxxxxxxxxx
>> My application was running on an XP SP2 machine, with the
>> regional settings set to give a "." as the decimal separator.
>>
>> I went into the control panel, and changed the settings to a ","
>> decimal separator, while the app was running.
>>
>> At that point, I got an error which looks like it was caused by
>> Str$ returning a number like 2.94 as "2,94". This code runs on a
>> regular timer, and the error only occured once. It also doesn't
>> occur if you switch regions with the app shut down.
>>
>> Is this known behaviour?
>

> Str/Val both ignore the user's regional settings. They always use
> the ".". This is actually very useful if you're generating SQL/MDX
> queries with floating-point constants in, or generating
> VB/VBScript source code, or reading locale-independent decimal
> values from a file.

Yes, it was actually an SQL query generation that raised the error
that alerted me to the problem. But as I say, in this case, Str$
returned a number with a comma separator, either during or just after
a change in the regional number format settings in the control panel.
.



Relevant Pages

  • Re: Strange behaviour of Str$
    ... I noticed that the first time you change the ... regional settings, it takes an inordinate length of time for the operation ... >> occur if you switch regions with the app shut down. ... > Dim output As String ...
    (microsoft.public.vb.general.discussion)
  • Re: Printing Problems - Access2003
    ... My app has a "Set Specific Printer" routine, ... I'll bear it in mind as those regional settings are quite likely ...
    (microsoft.public.access.conversion)
  • Re: Reginal Setting of short date
    ... regional settings to accomodate your app, you don't know the "moralities" of ... Being able to Localize the regional setting to my app only would be ... use the Date data type and controls like the DTPicker and MonthView and date ... reason to mess around with a user's regional date format settings. ...
    (microsoft.public.vb.general.discussion)
  • Re: Strange behaviour of Str$
    ... > settings set to give a "." ... > decimal separator, ... > occur if you switch regions with the app shut down. ... Dim output As String ...
    (microsoft.public.vb.general.discussion)
  • Re: Regional Settings
    ... Regional settings in SQL Server do not apply to decimal separators. ... decimal separator SQL Server recognises is the dot. ...
    (microsoft.public.sqlserver.programming)