What happened to the profile?
Dirk Hohndel
dirk at hohndel.org
Mon Oct 7 08:07:16 UTC 2013
On Mon, 2013-10-07 at 11:39 -0300, Tomaz Canabrava wrote:
> > It replaces atof by atof_l which takes an additional locale
> argument
> > where I force feed it en_US. If this is considered to be the
> way to go,
> > this locale for numeric values should be allocated once and
> for all in
> > some startup code (where?) and not every time we have to
> parse a number
> > in an xml file as it is now.
>
> That seems like a reasonable approach.
>
> Except that atof_l doesn't appear to exist on Linux. Some
> googling seems
> to imply that this is a BSD-ism that hasn't made its way to
> Linux. So
> back to square 1...
>
> Thiago - I'm sure there is this brilliant easy to use Qt
> function that
> will solve all our problems, correct?
>
>
> From the Qt docs, on QString.toDouble()
>
>
> This function tries to interpret the string according to the current
> locale. The current locale is determined from the system at
> application startup and can be changed by
> calling QLocale::setDefault(). If the string cannot be interpreted
> according to the current locale, this function falls back on the "C"
> locale.
>
So what does it do with a string of "1.50m" if the locale is de_DE ?
I guess I can test that easily :-)
(but my problem is the definition of "cannot be interpreted"... I'd much
rather want a function that I can tell "USE C LOCALE")
/D
More information about the subsurface
mailing list