Página 1 de 1

Rounding

Publicado: Mar Oct 06, 2009 3:06 am
por Pedro Sousa e Faro
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

Rounding

Publicado: Mar Oct 06, 2009 1:10 pm
por Pedro Sousa e Faro
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
>
>
>
>
>
>
>
>
>