[FX.php List] Getting floating point numbers through FX

Andrew Denman adenman at tmea.org
Wed Nov 1 08:38:09 MST 2006


>From my research, PHP 4.3.0 changed the way numbers are handled with respect
to the locale and decimal separator.  Any PHP version after 4.3.0 will
always treat "." as the correct decimal separator - "," is not valid.
Before 4.3.0 the locale set would determine the decimal separator.  Needless
to say, this change caused some problems when it was first introduced a few
years ago: http://bugs.php.net/bug.php?id=17079

(Incidentally, the last post on that bug shows where in the PHP source the
setting is set (in PHP 4 at least), so if you're of the hacking type you
could compile your own PHP version...)

Back to your problem, it appears FileMaker is working the way PHP used to
work by correctly outputting numbers according to your locale.  The question
is what setting is it using?  I don't see any settings within FileMaker, so
it's probably using the computer's setting.  If it's not possible to change
this, you'll have to run a replace in PHP to swap "." and "," so it's in the
format PHP expects.

Andrew Denman

-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Erik Andreas
Cayré
Sent: Tuesday, October 31, 2006 5:09 PM
To: FX.php Discussion List
Subject: Re: [FX.php List] Getting floating point numbers through FX


Den 31/10/2006 kl. 23.49 skrev Kevin Futter:

> On 1/11/06 9:32 AM, "Erik Andreas Cayré" <erik at cayre.dk> wrote:
>
>> I still have this problem...
>>
>> Den 01/10/2006 kl. 18.19 skrev Gjermund Gusland Thorsen:
>>
>>> Where did you get the coma "," ?
>>
>> In the array output from FX.
>>
>> I have a number field in FM containing numbers like ",7", ",32" etc.
>> They are formatted in FM as percent, so they are shown as "70%",
>> "32%" etc.
>>
>>
>>> My FMSA outputs period "." as decimal separator
>>
>> I tried some settings on the layout used by FX, but it didn't change
>> anything.
>>
>> So:
>> -does the WPE treat all fields as strings?
>> -or is it FX?
>> -can PHP use a comma as decimal point (using local settings?)?
>> -does "Use system formats" have any influence on CWP?
>
> The WPE has no choice but to treat all fields as strings - it's XML  
> after
> all.

Good point!

So it's a Filemaker thing...

Does anyone else have a solution besides doing all sorts of string  
manipulation in PHP?

Maybe I should submit a bug report/feature request to FMI...


---
Erik Andreas Cayré
Spangsbjerg Møllevej 169
DK-6705 Esbjerg Ø

Home Tel: +45 75150512
Mobile: +45 40161183

»If you can't explain it simply, you don't understand it well enough.«
-- Albert Einstein

»If you don't have time to do it right, when will you have time to do  
it over?«
-- John Wooden, basketball coach


_______________________________________________
FX.php_List mailing list
FX.php_List at mail.iviking.org
http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list