El vie, 25-11-2011 a las 14:34 +0100, Bart escribió:
> On 11/25/11, Santiago A. <[email protected] <mailto:[email protected]>> 
> wrote:
> > El 25/11/2011 10:16, Kjow escribió:
> >
> > What about the standard pascal function  "val"
> >
>
> Doesn't Val() use a hardcoded period (.) as decimalseparator?
> The StrToFloat() family uses (Default)FormatSettings AFAIK.
>
> Bart

Yes, it does. val uses dot as decimal separator In fact, I am Spanish
and I use ',' as decimal separator, so I have such problem.

I remember I had used a similar function (in delphi). It deletes '.'
(just in case it has thousands separators) then replaces ',' for '.', 
then applies the 'val'. Probably it could be checked faster scanning
chars. But I found that function written and I didn't waste more time
optimizing it, anyway it is wide long much better than rising exceptions.

By the way, I don't have a delphi near to check it. Is tryStrTofloat a
fpc function or it is also a delphi function? If there is such function
in delphi, someone gave up searching help too soon.

Regards
Santiago A.
[email protected]
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to