Re: Problem with locale

From: Max Kudrenko (vb_mvp_at_hotmail.com)
Date: 02/07/05


Date: 7 Feb 2005 03:38:22 -0800

Ivan,

If you use your app in Germany, you should have German locale and CDbl
will always recognize it. Type Conversion Functions are internationally
aware and work properly for any one locale. So your problem isn't quite
clear as both the app and the user will treat all the formating the
same way which is the expected behaviour.

Max Kudrenko
Brainbench MVP Program for Visual Basic
www.brainbench.com

Ivan wrote:
> Hi,
> I have the following problem:
> I read a numeric (double) value stored in simple text file (i.e
"2.25") and
> convert it to a double using CDbl. Works fine until used on a client
with
> non-english locale. For example, if German locale is set, which uses
(,) as a
> decimal separator and (.) as a group separator, then the CDbl returns

> (correctly, I guess) 225. Is there any straightforward way to deal
with this
> (besides changing locales back and forth, or detecting locales and
> manipulating the string?)
> Thanks,
> Ivan



Relevant Pages

  • Re: Reading an excel spreadsheet using Lisp
    ... >> delimiter is a semicolon ... > That's because you're operating in a German locale. ...
    (comp.lang.lisp)
  • Re: perl: warning: Setting locale failed.
    ... > Christian Semrau wrote: ... >> Where can I change my locale settings, so that I use a german locale? ...
    (comp.os.linux.misc)
  • 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: Decimal commas instead of decimal points
    ... Don't mix the locale-aware functions (CStr, CDbl, etc) with the ... with CSng or CDbl) then it automatically expect the correct decimal-point ... These alternatives to CStr and CDbl ... the only two VB functions that don't honour the current locale. ...
    (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)