Why is it a difference when compiling on win and linux lazarus / 32-Linux ---------------------------------------------------------------------- MHL · 2015-05-16 06:13 Hi, Why when I doing something like this: Code: [Select]ZQuery.FieldByName('AMOUNT').AsFloat := ZQuery.FieldByName('AMOUNT').AsFloat * ZQuery.FieldByName('RATING').AsFloat;    and RATING is a NUMERIC(9,4) field, it's ok on windows, but on linux a get a floating point exception and I must do it like this: Code: [Select]ZQuery.FieldByName('AMOUNT').AsFloat := ZQuery.FieldByName('AMOUNT').AsFloat *  StrToFloat(StringReplace(ZQuer y.FieldByName('RATING').AsString,',','.',[rfReplaceAll])); to work it fine. But, isn't this should work that same on Windows and Linux? Is it bug in FPC or TZQuery? I use Lazarus 1.2.2, FPC 2.6.4 on Fedora 20, Firebird 2.5.2, Zeos ver. 7.1. Anyone have a idea? Thanks for any answer. ---------------------------------------------------------------------- zeljko · 2015-05-16 07:21 You should ask at Zeos forum. ---------------------------------------------------------------------- Leledumbo · 2015-05-16 07:34 I guess that's easy. If you need to convert decimal separator to make it work, then your locale is not the same on win and lin. It's not just the OS, but your db server as well. If your program and the db server communicate using different locale, certainly it will cause exception. One side expects , while the other expects . as decimal separator. ---------------------------------------------------------------------- zeljko · 2015-05-16 10:51 Leledumbo, I don't know any database that supports decimalseparator <> . (dot). In his example he's got "," from database as decimal separator. That's pretty weird. I think it's bug in zeos somewhere. ---------------------------------------------------------------------- MHL · 2015-05-16 13:28 Quote from: Leledumbo on May 16, 2015, 09:34:41 amI guess that's easy. If you need to convert decimal separator to make it work, then your locale is not the same on win and lin. It's not that simple, because it was a bug in my application used by many client. Every one on linux got that bug (about 30-40 client). I don't beleve they have that same locale becouse they have many various linux (fedora, centos, open suse that I know), every was installed by different person. On Fedora 20 I only compiling that application. But zeljko you have rigth, I should ask on Zeos forum. Thanks again for Your answer! ---------------------------------------------------------------------- Leledumbo · 2015-05-16 13:29 Quote from: zeljko on May 16, 2015, 12:51:03 pmThat's pretty weird. I think it's bug in zeos somewhere. Could be. I should've thought that SQL expects standardized format, so the problem might be in the library. ---------------------------------------------------------------------- miab3 · 2015-05-21 10:43 @MHL, You should try ZEOS 7.2(current). Zeos7.2-beta branches_ testing_Revision 3628: http://svn.code.sf.net/p/zeoslib/code-0/branches/testing-7.2/ http://zeoslib.sourceforge.net/viewtopic.php?f=40&t=3795&start=330#p41 664 It has change for the scale 1-4. See also: http://sourceforge.net/p/zeoslib/tickets/106/ Michal ---------------------------------------------------------------------- miab3 · 2015-05-23 15:24 @MHL, I checked: Code: [Select]Edit1.Text:=FloatToStr(ZTable2.FieldByName('F13_0').AsFloat + ZTable2.FieldByName('F3_3').AsFloat + ZTable2.FieldByName('F10_5').AsFloat); Zeos7.2-beta branches_ testing_Revision 3628 does not cause an error for FireBird 2.53 and Lazarus 1.4-64 on Debian8-64, Lazarus 1.4-32 on Windows7-32 and Delphi XE2-32/64 on windows7-64 Michal