Problem with numeric fields and FWH 25.01
- cnavarro
- Posts: 6658
- Joined: Wed Feb 15, 2012 8:25 pm
- Location: España
- Has thanked: 9 times
- Been thanked: 12 times
Re: Problem with numeric fields and FWH 25.01
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
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
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
- Silvio.Falconi
- Posts: 7255
- Joined: Thu Oct 18, 2012 7:17 pm
- Has thanked: 2 times
- Been thanked: 29 times
Re: Problem with numeric fields and FWH 25.01
I saw many topic on web with problems on MariaDb and Decimalsvilian wrote: Fri Mar 28, 2025 7:17 pm Dear Cristobal,
The type of the fields is:
QTE DECIMAL(11,3)
VALOR DECIMAL(12,4)
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
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
- cnavarro
- Posts: 6658
- Joined: Wed Feb 15, 2012 8:25 pm
- Location: España
- Has thanked: 9 times
- Been thanked: 12 times
Re: Problem with numeric fields and FWH 25.01
Dear Silviovilian 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
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
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
-
- Posts: 1019
- Joined: Wed Nov 09, 2005 2:17 am
- Location: Brazil
- Has thanked: 5 times
- Been thanked: 2 times
- Contact:
Re: Problem with numeric fields and FWH 25.01
Any Progress?
I really wanted update my FWH version to try webview2, but with this problem, I can't do it
I really wanted update my FWH version to try webview2, but with this problem, I can't do it

- cnavarro
- Posts: 6658
- Joined: Wed Feb 15, 2012 8:25 pm
- Location: España
- Has thanked: 9 times
- Been thanked: 12 times
Re: Problem with numeric fields and FWH 25.01
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
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
-
- Posts: 1019
- Joined: Wed Nov 09, 2005 2:17 am
- Location: Brazil
- Has thanked: 5 times
- Been thanked: 2 times
- Contact:
Re: Problem with numeric fields and FWH 25.01
I sent it again to your email. please, let me know if you need something else.
- Enrico Maria Giordano
- Posts: 8784
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 9 times
- Contact:
Re: Problem with numeric fields and FWH 25.01
We need a little sample to reproduce the problem. The sample must be compilable and runnable without any not available external dependencies (database included).
-
- Posts: 1019
- Joined: Wed Nov 09, 2005 2:17 am
- Location: Brazil
- Has thanked: 5 times
- Been thanked: 2 times
- Contact:
- Enrico Maria Giordano
- Posts: 8784
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Has thanked: 1 time
- Been thanked: 9 times
- Contact:
- Antonio Linares
- Site Admin
- Posts: 42837
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 170 times
- Been thanked: 123 times
- Contact:
Re: Problem with numeric fields and FWH 25.01
Dear Vilian,
Thanks to Hakan Öztürk as has found the difference in the code
It seems as Mr. Rao changed a call to hb_valStrnToNum() into a call to hb_strnToNum()
According to Mr. Rao's notes:
The modified code uses this now:
We can revert this change and send you a modified lib for your testing. Please let me know if you want it for 32 or 64 bits ? Borland or MSVC ? many thanks!
Thanks to Hakan Öztürk as has found the difference in the code

It seems as Mr. Rao changed a call to hb_valStrnToNum() into a call to hb_strnToNum()
According to Mr. Rao's notes:
Code: Select all | Expand
#ifdef REMOVED
/*
hb_arraySetND( aRow, i + 1, ( mrow[ i ] == NULL ? 0.0 : hb_strVal( mrow[ i ], aLen[ i ] ) ) );
break; // loss of accuracy in case of bigint large numbers
*/
/*
// nor working in case of double datatpe with large numbers
if( ! hb_valStrnToNum( mrow[ i ], aLen[ i ], &lValue, &dValue, &iDec, &iWidth ) )
{
hb_arraySetNL( aRow, i + 1, ( long ) lValue );
}
else
{
hb_itemPutNDLen( itemTmp, dValue, iWidth, iDec );
hb_arraySetForward( aRow, i + 1, itemTmp );
}
break;
*/
#endif
Code: Select all | Expand
case 'N':
if ( ( nAt = ( int ) hb_strAtI( "e", 1, mrow[ i ], aLen[ i ] ) ) > 0 )
{
dValue = hb_strVal( mrow[ i ], aLen[ i ] );
x = ( int ) hb_strVal( mrow[ i ] + nAt, aLen[ i ] - nAt );
dValue *= pow( ( double ) 10.0, ( double ) x );
hb_arraySetND( aRow, i + 1, dValue );
}
else
{
if ( hb_strnToNum( mrow[ i ], aLen[ i ], &lValue, &dValue ) )
{
hb_arraySetND( aRow, i + 1, dValue );
}
else
{
hb_arraySetNLL( aRow, i + 1, lValue );
}
}
break;
-
- Posts: 1019
- Joined: Wed Nov 09, 2005 2:17 am
- Location: Brazil
- Has thanked: 5 times
- Been thanked: 2 times
- Contact:
Re: Problem with numeric fields and FWH 25.01
Hi Vilian,
Can you solved your lost connection problems?
Best Regards,
Ertan Hakan ÖZTÜRK
ertan_ozturk@yahoo.com
Can you solved your lost connection problems?
Best Regards,
Ertan Hakan ÖZTÜRK
ertan_ozturk@yahoo.com
-
- Posts: 1019
- Joined: Wed Nov 09, 2005 2:17 am
- Location: Brazil
- Has thanked: 5 times
- Been thanked: 2 times
- Contact:
Re: Problem with numeric fields and FWH 25.01
Good Morning Antonio,Antonio Linares wrote: Sun Apr 20, 2025 3:13 pm Dear Vilian,
Thanks to Hakan Öztürk as has found the difference in the code![]()
It seems as Mr. Rao changed a call to hb_valStrnToNum() into a call to hb_strnToNum()
According to Mr. Rao's notes:The modified code uses this now:Code: Select all | Expand
#ifdef REMOVED /* hb_arraySetND( aRow, i + 1, ( mrow[ i ] == NULL ? 0.0 : hb_strVal( mrow[ i ], aLen[ i ] ) ) ); break; // loss of accuracy in case of bigint large numbers */ /* // nor working in case of double datatpe with large numbers if( ! hb_valStrnToNum( mrow[ i ], aLen[ i ], &lValue, &dValue, &iDec, &iWidth ) ) { hb_arraySetNL( aRow, i + 1, ( long ) lValue ); } else { hb_itemPutNDLen( itemTmp, dValue, iWidth, iDec ); hb_arraySetForward( aRow, i + 1, itemTmp ); } break; */ #endif
We can revert this change and send you a modified lib for your testing. Please let me know if you want it for 32 or 64 bits ? Borland or MSVC ? many thanks!Code: Select all | Expand
case 'N': if ( ( nAt = ( int ) hb_strAtI( "e", 1, mrow[ i ], aLen[ i ] ) ) > 0 ) { dValue = hb_strVal( mrow[ i ], aLen[ i ] ); x = ( int ) hb_strVal( mrow[ i ] + nAt, aLen[ i ] - nAt ); dValue *= pow( ( double ) 10.0, ( double ) x ); hb_arraySetND( aRow, i + 1, dValue ); } else { if ( hb_strnToNum( mrow[ i ], aLen[ i ], &lValue, &dValue ) ) { hb_arraySetND( aRow, i + 1, dValue ); } else { hb_arraySetNLL( aRow, i + 1, lValue ); } } break;
When will it be available to me ?