Re: Strange behaviour of Str$



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.

Most people would say they are "not locale aware". I prefer to view them as
honouring a "programming locale" (i.e. most programming languages use
US-format decimal values, and sometimes even US-format date values - as with
VB)

Tony Proctor

"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?


.



Relevant Pages

  • LANG, locale, unicode, setup.py and Debian packaging
    ... On start I call locale.setlocale, the getlocale. ... The app assumes unicode objects internally. ... My setup.py also tests locale (because it then loads gettext ... happens if LANG is set to "C", ...
    (comp.lang.python)
  • Re: dealing with currencies and different locales....
    ... Not all European countries use "," as a decimal separator. ... mismatch errors at times when my locale wasn't set to US. ... Is there anything else I should know about displaying currencies in text ...
    (comp.lang.basic.visual.misc)
  • Re: vb6 question
    ... runtime behavior to make it insensitive to system locale. ... will still interpret it on the basis of the global locale setting. ... What Rick wants/needs is a way to control that behavior for a single app ...
    (microsoft.public.vb.general.discussion)
  • Re: Change , to .
    ... Does your locale use the coma for the decimal separator? ... Having a PC that uses the coma as a decimal sperator go to the immediate ... Note how I typed in the dot as a decimal seperator. ...
    (microsoft.public.vb.general.discussion)
  • Re: test if a string is a valid number?
    ... VB is internationalized => soubroutine must take locale into the account. ... Won't require any effort on your part except adding CLR support to your ... not you also want to support postfix sign (which is one of the locale ... 32-bit app on the ...
    (microsoft.public.vc.mfc)