Problem with numeric fields and FWH 25.01

User avatar
cnavarro
Posts: 6605
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Has thanked: 6 times
Been thanked: 8 times

Re: Problem with numeric fields and FWH 25.01

Post by cnavarro »

Dear Vilian
I've reviewed the latest changes made to classes that may affect this issue, and I haven't seen any significant changes that could alter the behavior compared to previous versions.
Can you provide me with a .sql file that can create the table (including the structure you use) and with some example rows?
Thanks
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
Silvio.Falconi
Posts: 7235
Joined: Thu Oct 18, 2012 7:17 pm
Been thanked: 16 times

Re: Problem with numeric fields and FWH 25.01

Post by Silvio.Falconi »

vilian wrote: Fri Mar 28, 2025 7:17 pm Dear Cristobal,

The type of the fields is:

QTE DECIMAL(11,3)
VALOR DECIMAL(12,4)
I saw many topic on web with problems on MariaDb and Decimals


one man give me this link perhaps can help you
https://docs.oracle.com/javase/8/docs/a ... ormat.html
https://mariadb.com/kb/en/decimal/
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
cnavarro
Posts: 6605
Joined: Wed Feb 15, 2012 8:25 pm
Location: España
Has thanked: 6 times
Been thanked: 8 times

Re: Problem with numeric fields and FWH 25.01

Post by cnavarro »

vilian wrote: Wed Mar 19, 2025 11:12 am Hi Guys,
IF I run the code bellow with my previous version of FWH. I can see the value 3.3732. But if i run this same code with the new version of FWH, the value showed is 3.37. Do you know why ?

Code: Select all | Expand

function Main()
LOCAL oRs,oCn,oError,oQry,cQryMat

   SET DATE BRIT
   SET CENTURY ON
   
   CursorWait()

   oCn := Maria_Connect( aStr[1] )

   oRs := oCn:Query("SELECT nfiscal,cmat,qte,qtedig FROM consumo WHERE nfiscal LIKE '000005829%'")
   cQryMat := ""
   DO WHILE .NOT. oRs:Eof()
      cQryMat += "'"+oRs:cmat+"',"
      ? oRs:qte,oRs:qtedig,oRs:cmat
      oRs:Skip()
   ENDDO
   oRs:GoTop()
   
RETURN NIL
Dear Silvio
We'll have to try to find out why it worked correctly with the previous version ( 23.11 ), but not with the current one, right?
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
vilian
Posts: 1007
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Has thanked: 3 times
Contact:

Re: Problem with numeric fields and FWH 25.01

Post by vilian »

Yes.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Post Reply