TFMTBCDField - wrong range check lazarus / 16-Databases ---------------------------------------------------------------------- emilt · 2022-01-08 10:17 With new Lazarus 2.2.0, an error started to appear on trying to update a TFMTBCDField: Quoteerror: 1.00 is not between 0.00 and 0.00 This only happens when I set the field's ProviderFlags to include pfRefreshOnUpdate. It also happens when I try to insert with pfRefreshOnInsert. Don't know if it is relevant, this is a Firebird 3 DECIMAL(15, 6) field, and I'm using FPC's IBConnection. Maybe someone could point me at least where to look? TFMTBCDField looks OK to me. The range error should not appear if at least one of MinValue and MaxValue are 0. ---------------------------------------------------------------------- emilt · 2022-01-08 15:06 OK, found it! https://gitlab.com/freepascal.org/fpc/source/- /commit/573917706fb5a5cffd76239e90ef62fdee041f68 The patch works for me. It's in FPC's RTL, so this must be rebuilt. I used Code: Text  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i fppkg install from the fpc\3.2.2\source\packages\rtl-objpas directory. ---------------------------------------------------------------------- brick08 · 2022-01-14 04:50 This happens because when converting zero from a string and an integer, you get a different Precision. Try it: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  bcd, sbcd, ibcd: tBCD;begin  ibcd:=IntegerToBCD(0);  sbcd:=StrToBCD('0');  if sbcd = ibcd then    ShowMessage('Equals')  else    ShowMessage('Not Equals');  if sbcd = 0 then    ShowMessage('sbcd = 0')  else    ShowMessage('sbcd <> 0');  if ibcd = 0 then    ShowMessage('ibcd = 0')  else    ShowMessage('ibcd <> 0'); this patch helps me too, problem done