Hi
Recently i'm experieced a rounding problem in Xailer:
I create a Temp table (MSSQL) with type [decimal] (15,2) and define a
Dataset to this table.
The folowing code:
::t_temp:addnew()
::t_temp:acu_ger_deb=vdb_gr // vdb_gr=30.38
msginfo(::t_temp:acu_ger_deb ) // returns 30.38
::t_temp:update() // add the record
msginfo(::t_temp:acu_ger_deb ) // returns 30.37 ???
The only way to solve this was to declare the temp table to type [decimal]
(15,3) , the doesn't make sense because the value has only 2 dec, but with
this, the value stored became 30.38
Is there any configuration in xailer that i'm missing ?
Regards
Pedro Faro
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Rounding
-
- Mensajes: 91
- Registrado: Mié May 30, 2007 5:25 pm
-
- Mensajes: 91
- Registrado: Mié May 30, 2007 5:25 pm
Rounding
Hi
It's not a Xailer problem -)
MSSQL datatype Decimal , when updated, truncates the decimal that is greater
that defined, DBF rounds automaticaly the decimal .
Ex, MSSQL : 20166.2999999998 becames 20166.29 in a decimal(15.2)
DBF : 20166.299999998 becames 20166.30 in numeric( 15.2)
One turn around is to take Money , instead of decimal.
Take in consideration this problem when converting your database to a SQL
language
Regards
Pedro
"Pedro Faro" <psfaro@shi.pt> escreveu na mensagem
news:4aca980b$[email=2@svctag-j7w3v3j....]2@svctag-j7w3v3j....[/email]
> Hi
>
> Recently i'm experieced a rounding problem in Xailer:
>
> I create a Temp table (MSSQL) with type [decimal] (15,2) and define a
> Dataset to this table.
>
> The folowing code:
>
> ::t_temp:addnew()
>
> ::t_temp:acu_ger_deb=vdb_gr // vdb_gr=30.38
> msginfo(::t_temp:acu_ger_deb ) // returns 30.38
> ::t_temp:update() // add the record
> msginfo(::t_temp:acu_ger_deb ) // returns 30.37 ???
>
> The only way to solve this was to declare the temp table to type
> [decimal] (15,3) , the doesn't make sense because the value has only 2
> dec, but with this, the value stored became 30.38
> Is there any configuration in xailer that i'm missing ?
>
> Regards
> Pedro Faro
>
>
>
>
>
>
>
>
>
It's not a Xailer problem -)
MSSQL datatype Decimal , when updated, truncates the decimal that is greater
that defined, DBF rounds automaticaly the decimal .
Ex, MSSQL : 20166.2999999998 becames 20166.29 in a decimal(15.2)
DBF : 20166.299999998 becames 20166.30 in numeric( 15.2)
One turn around is to take Money , instead of decimal.
Take in consideration this problem when converting your database to a SQL
language
Regards
Pedro
"Pedro Faro" <psfaro@shi.pt> escreveu na mensagem
news:4aca980b$[email=2@svctag-j7w3v3j....]2@svctag-j7w3v3j....[/email]
> Hi
>
> Recently i'm experieced a rounding problem in Xailer:
>
> I create a Temp table (MSSQL) with type [decimal] (15,2) and define a
> Dataset to this table.
>
> The folowing code:
>
> ::t_temp:addnew()
>
> ::t_temp:acu_ger_deb=vdb_gr // vdb_gr=30.38
> msginfo(::t_temp:acu_ger_deb ) // returns 30.38
> ::t_temp:update() // add the record
> msginfo(::t_temp:acu_ger_deb ) // returns 30.37 ???
>
> The only way to solve this was to declare the temp table to type
> [decimal] (15,3) , the doesn't make sense because the value has only 2
> dec, but with this, the value stored became 30.38
> Is there any configuration in xailer that i'm missing ?
>
> Regards
> Pedro Faro
>
>
>
>
>
>
>
>
>