Subject | Re: [IBO] How to Format a FLOAT field? |
---|---|
Author | marcoandrecarvalho |
Post date | 2005-02-27T13:27:23Z |
--- In IBObjects@yahoogroups.com, "Paulo Carvalho"
<paulo.sergio@e...> wrote:
the result, change values in a grid for example?
I resolved the problem changing the data type of the column to
Numeric.
Thank you very much, Paulo!
Isso vai funcionar com o propósito de edição de resultados? Digo, eu
quero ser capaz de editar os valores em um grid por exemplo.
Solucionei o problema convertendo o tipo de dado dessa coluna por
Numeric.
Muito obrigado Paulo!
[]s, Marco André
_____
_____
<paulo.sergio@e...> wrote:
> Hi Marco,Hi Paulo!
>No.
> Do already try use the FireBird function "round"?
> This function have two parameters:It will work for editing intention, i mean, i want to be able to edit
> 1º - the Field (a double value)
> 2º - number of precision
>
> Ex: select round(num,2) from tableX where ...
>
> if the "num" is 12.2156523123 this select retrive 12.21
>
> Regards,
the result, change values in a grid for example?
I resolved the problem changing the data type of the column to
Numeric.
Thank you very much, Paulo!
>Não.
> [Português]
> Oi Marcos,
>
> Você já tentou usar a função "round" do FireBird?
> Esta função recebe dois parâmetros:12.21
> 1º - o campo que você deseja selecionar (valor real)
> 2º - o numero de casas decimais que você deseja
>
> Ex: select round(num,2) from tabelaX where ...
>
> Se num valer 12.2156523123 o valor retornado pelo select será:
>Blz!
> Blz?!
Isso vai funcionar com o propósito de edição de resultados? Digo, eu
quero ser capaz de editar os valores em um grid por exemplo.
Solucionei o problema convertendo o tipo de dado dessa coluna por
Numeric.
Muito obrigado Paulo!
[]s, Marco André
>12.2156523123,
> Paulo Sérgio Carvalho
> Tecnologia de Informação
>
> Engeman EAM Ltda
> paulo@e...
> http://www.engeman.com.br
> ++ 55 (037) 3241 - 1084
>
> ----- Original Message -----
> From: marcoandrecarvalho
> To: IBObjects@yahoogroups.com
> Sent: Thursday, February 24, 2005 3:39 PM
> Subject: [IBO] How to Format a FLOAT field?
>
>
>
> Hi All!
>
> I want to format a float field with 2 decimals, ex.:
> converted = 12.21. I tried to usethis
> IB_Connection.FieldsDisplayFormat := 'TEST=0.00' and
> IB_Connection.FieldEntryTypes = fetDomainName, but it gives me
> error: "EConvertError with message "xxxx" is not a valid integer______________________________________________________________________
> value".
>
> I also tried to use CalculateFields, but without success either:
>
> IB_Query1.CalculatedFields := 'TEST FLOAT NOT NULL' with the
> following event:
>
> procedure TDataModule1.taTestCalculateField(Sender: TIB_Statement;
> ARow: TIB_Row; AField: TIB_Column);
> begin
> if AField.FieldName = 'GANHO' then
> AField.AsString := FormatFloat('##0.00',ARow.ByName
> ('TEST').AsFloat);
> end;
>
> Can anyone give me a tip? What i´m doing wrong?
>
> []s, Marco André
>
>
>
>
>
>
_____
> IB Objects - direct, complete, custom connectivity to Firebird orInterBase
> without the need for BDE, ODBC or any other layer.______________________________________________________________________
>
_____
> http://www.ibobjects.com - your IBO community resource for TechInfo papers,
> keyword-searchable FAQ, community code contributions andmore !
>----------
>
> Yahoo! Groups Sponsor
> ADVERTISEMENT
>
>
>
>
>
> --------------------------------------------------------------------
> Yahoo! Groups LinksService.
>
> a.. To visit your group on the web, go to:
> http://groups.yahoo.com/group/IBObjects/
>
> b.. To unsubscribe from this group, send an email to:
> IBObjects-unsubscribe@yahoogroups.com
>
> c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>
>
>
> [Non-text portions of this message have been removed]