Subject Re: [IBO] Decimal separator
Author Helen Borrie
At 09:42 PM 23/08/2005 +0000, you wrote:
> Hi to all board.
> Does anyone knows if are there any way to set the decimal separator
>from ibo, or, at least, from firebird?

You do it from Delphi, using the variable SysUtils.DecimalSeparator. In
the VCL help, if you click through from the index entry for
DecimalSeparator, you can see a full rundown of all of the formatting
variables that can be set. If you set these in your DPR unit, you don't
have to be concerned about them further.

>I know i can set it in the
>operating system and from there firebird sets it,

I don't quite know what you are referring to here. Firebird doesn't format
numbers at all. Indeed, it doesn't format any type of data.

>but i need to always force it to dot( in my state it is comma ).

Provided you set the local format variables in Delphi the way you require
them, Delphi will always display them in the needed format.

What you do need to cater for specifically is the case where you read a
number from the Text property of a control, that you want to apply to a
parameter, a dataset field or an arithmetic expression.

-- This practice should be avoided with data-aware controls (read the value
of the field in the dataset, since the dataset manages the value
independently of the text display).

-- With non-data-aware controls, you will have to employ a decoding routine
to convert the string to a format that is valid for converting to the SQL
data type. If you use a TMaskEdit for such input fields, you can achieve
this quite easily.

-- Don't overlook the usefulness of the ParamName property of the native IB
data-aware controls. When you have a parameterised query as your
statement's SQL, this property allows you, for example, to display a
TIB_Edit datalinked to the same IB_Datasource as the fields of the dataset,
link the control to a parameter name, and use the control to capture the
input value for direct assignment to the parameter, without you needing to
decode a Text string by your own means. When using the control for
ParamName, leave the Datafield property nil.

Helen