dkeene Posted May 26, 2020 Share Posted May 26, 2020 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 More sharing options...
Sherzod Posted May 26, 2020 Share Posted May 26, 2020 2 hours ago, dkeene said: aUniDBEdit.Mask.Text:='999.999'; Hello, Please explain in more detail. Do you mean InputMask.Mask ? Link to comment Share on other sites More sharing options...
dkeene Posted May 27, 2020 Author Share Posted May 27, 2020 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. Link to comment Share on other sites More sharing options...
Sherzod Posted May 27, 2020 Share Posted May 27, 2020 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? Link to comment Share on other sites More sharing options...
dkeene Posted May 27, 2020 Author Share Posted May 27, 2020 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' Link to comment Share on other sites More sharing options...
dkeene Posted May 28, 2020 Author Share Posted May 28, 2020 Any thoughts on this? Link to comment Share on other sites More sharing options...
x11 Posted May 28, 2020 Share Posted May 28, 2020 try replace . -> , (replace dot on coma) Link to comment Share on other sites More sharing options...
x11 Posted May 28, 2020 Share Posted May 28, 2020 -*-- Link to comment Share on other sites More sharing options...
dkeene Posted May 28, 2020 Author Share Posted May 28, 2020 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 More sharing options...
x11 Posted May 28, 2020 Share Posted May 28, 2020 1 hour ago, dkeene said: are you saying to use '999*999'? no replace dot to TFormatSettings.DecimalSeparator; Link to comment Share on other sites More sharing options...
x11 Posted May 28, 2020 Share Posted May 28, 2020 Var FormatSettings : TFormatSettings ; begin ... ... Query1.FieldByName('num').asFloat := StringReplace(uniEdit1.Text, '.',FormatSettings.DecimalSeparator , []); Link to comment Share on other sites More sharing options...
dkeene Posted May 29, 2020 Author Share Posted May 29, 2020 there must be a better way to use this mask as it's intended Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now