Jump to content

Recommended Posts

Posted

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...

Posted

Sorry, Yes. InputMask.Mask

If I assign the Input.Mask as '999.999' for example, and enter 123.234, 

the control reports error: '123.23_' is not a valid number. Please see attached.

snap108.png

Posted
1 minute ago, dkeene said:

the control reports error: '123.23_' is not a valid number. Please see attached.

Can you please make a simple testcase for reproduce?

Posted

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

Posted

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.

Posted
1 hour ago, dkeene said:

are you saying to use '999*999'?

no

replace dot to TFormatSettings.DecimalSeparator;

Posted
Var

FormatSettings : TFormatSettings ;

begin

...

...

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

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...