Jump to content

TUniDBEdit


dkeene

Recommended Posts

Hello could someone please help me with an example (not using javascript modifications) to make the Edit Mask work?

aUniDBEdit.Mask.Text:='999.999';

 

when user types a number, the input mask is validated with the first number such that:

'2__.___' is not a valid floating point number. error occurs...

Link to comment
Share on other sites

MySQL database table has field dkcontrols.num3by3 which is a decimal(6,3) which represents values from - 999.999 to +999.999 (6 digists, 3 of which are decimal.

I set up a TUniDBNumberEdit control linked to datafield num3by3.

I assign TUniDBNumberEdit.InputMask.Mask:='999.999';

I place cursor in TUniDBNumberEdit Box which initially shows: '___.___' and type in '234.234' which it accepts.

I move cursor to another box and error shows: '234.23_ is not a valid number'

snap109.png

Link to comment
Share on other sites

Thank you x11, but that did not work. are you saying to use '999*999'?

The point of a mask is for visual cue about the data to be entered. so, if field is 3 digits by 3 decimal points, i am trying to show:

###.### or something for user.

Link to comment
Share on other sites

Var

FormatSettings : TFormatSettings ;

begin

...

...

Query1.FieldByName('num').asFloat := StringReplace(uniEdit1.Text, '.',FormatSettings.DecimalSeparator , []);

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...