Fórum Formatação de moeda/float - Socorro!!!!!!!! #159159

09/05/2003

0

Caros colegas,
Estou com um problema de formatação. É o seguinte, em meu aplicativo o banco, interbase, tem um campo PRECO do tipo NUMERIC(9,2). Estou utilizando SQLConnection, SQLDataSet, DataSetProvider e ClientDataSet para acessar os dados do banco. O TField no ClientDataSet está com o tipo TFMTBCDField. Defini o TField desse campo como currency e as propriedades DisplayFormat e EditFormat como #,,0.00 ou
,0.00 mas os dados continua sem formatação. Esles ficam no formato 2.254.00 e se tentar colocar (,) dá um erro, por exemplo, se tentar colocar 20,2 dará o seguinte erro: is not a valid BCD value.
Se alguem puder me ajudar ficarei muito agradecido.


Cic.pop

Cic.pop

Responder

Posts

09/05/2003

Aroldo Zanela

Hi,

> Does anybody work with dbExpress and Oracle. A have a lot of problems - i´m
> retrieving float field but receive TFMTBCDField without decimal separator, I can´t
> do SQLConnection.Execute and get output cursor, and I have problems with Number
> parameters of stored procedures. Do you know what is it, or where I can read more
> about how to use dbExpress - I´d like to find some working examples. Maybe I do
> something wrong? Help me please!

I had such problems too. I´v inserted the following statement into the
´AfterConnect´-Event:

SQLConnection.Execute(´alter session set NLS_NUMERIC_CHARACTERS=´´.,´´´, NIL,NIL);

Maybe this helps.
link: http://dbforums.com/archives/t297686.html


Responder

Gostei + 0

09/05/2003

Aroldo Zanela

Hi,

> Does anybody work with dbExpress and Oracle. A have a lot of problems - i´m
> retrieving float field but receive TFMTBCDField without decimal separator, I can´t
> do SQLConnection.Execute and get output cursor, and I have problems with Number
> parameters of stored procedures. Do you know what is it, or where I can read more
> about how to use dbExpress - I´d like to find some working examples. Maybe I do
> something wrong? Help me please!

I had such problems too. I´v inserted the following statement into the
´AfterConnect´-Event:

SQLConnection.Execute(´alter session set NLS_NUMERIC_CHARACTERS=´´.,´´´, NIL,NIL);

Maybe this helps.
link: http://dbforums.com/archives/t297686.html


Responder

Gostei + 0

09/05/2003

Marcelo.c

Certa vez resolvi este problema colocando [b:fc4241dde2] R$ 0.00[/b:fc4241dde2] em DisplayFormat.


Responder

Gostei + 0

09/05/2003

Cic.pop

Olá Aroldo Zanela,
Posso te indicar algumas literaturas sobres dbExpress e stored procedures: Resvista ClubeDelphi Edições 22, 32 e 38 e 39. Livros: Sistemas Multicamadas com Delphi DataSnap e dbExpress, Editora Visual Books, Autor Anderson Haertel Rodrigues.

Espero ter ajudado!


Responder

Gostei + 0

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar