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... Quote 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 ? Quote 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. Quote 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? Quote 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' Quote 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? Quote 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) Quote Link to comment Share on other sites More sharing options...
x11 Posted May 28, 2020 Share Posted May 28, 2020 -*-- Quote 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. Quote 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; Quote 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 , []); Quote 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.