Jean-Marc Lasgouttes wrote:
> 
> >>>>> "Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
> 
> Angus> I've just discovered a small inconsistency here. I wasn't
> Angus> allowing the user to input anything other than an unsigned int
> Angus> for the screen font sizes. Since the defaults (on display) are:
> 
> Angus> \screen_font_sizes 5.0 7.0 8.0 9.0 10.0 12.0 14.4 17.28 20.74
> Angus> 24.88
> 
> Angus> Then that was probably a little irritating.
> 
> Angus> I'm thinking of a new fl_unsigned_float_filter. For the time
> Angus> being it's very simple. It will accept a ".", but should it
> Angus> also allow users to input a "," if they're "foreign"? Or is
> Angus> this exactly what LC_NUMERIC=C forbids?
> 
> Do not accept "," in floats. Concerning the filter, we have a
> isStrDbl in lstring.C which may be useful.
> 

I think it's a better solution to read/write from external file
with non-locale functions to avoid the format problems when exchange
files with other users or other program versions. But the
user interface should honor the locale environment of the
current user session.

Whilst the read/write of the external representation isn't fixed,
the user interface is bound to accepting "." only. But that's
automatic behaviour with LC_NUMERIC=C.

But I'm no C++ programmer,
I don't know the correct call-interface to achieve that.
With standard C I whould use:
  - [sf]printf to show a numeric value via user interface
  - a self-written function to save that number to external file
  - strtol/strtod to read a numeric user inputvalue
  - and a self-written function to read from external file

The use of setlocale() is a possiblity for the self-written functions,
but this isn't multi thread safe and you have to save and restore the
current value.

Regards, Stephan

PS. Sorry for sending this. I'm reading this list, but haven't
    any time to learn coding with C++ and contribute code.

------------------------------------------------
<[EMAIL PROTECTED]> | beusen Solutions GmbH
fon: +49 30 549932-62    | Landsberger Allee 366
fax: +49 30 549932-21    | 12681 Berlin, Germany
------------------------------------------------

Reply via email to