Using FloatSpinEdit lazarus / 21-General ---------------------------------------------------------------------- Neville · 2024-01-01 20:49 I have a need to allow the user to change the number of decimal places in FloatSpinEdit. Introducing this to an existing project, the control looses the decimal point when the change is made. Annoyingly, the component behaves exactly as required if I just put it on a test form with a couple of buttons to effect the change. I have just upgraded to Lazarus 3. ---------------------------------------------------------------------- jamie · 2024-01-01 22:00 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.FloatSpinEdit1Change(Sender: TObject);begin  With TFloatSpinEdit(Sender)do   Begin     decimalPlaces :=Length(text)-Pos('.',Text);   end;end;                                     you could try this?  Not exactly sure as to what you are actually trying to do but that will allow the user to edit the places after the decimal point and will keep the count. ---------------------------------------------------------------------- wp · 2024-01-01 22:55 Quote from: Neville on January 01, 2024, 09:49:17 pmIntroducing this to an existing project, the control looses the decimal point when the change is made. I am not sure what this means. My point of view, maybe off-topic, about an issue with this component when you allow the users to change the number of decimal places: The control is meant for user input of numbers only with the predefined number of decimal places. Its function depends heavily on rounding, the control only stores the rounded value. When the user has specified two decimal places and enters a number with more decimal places, the value is rounded to two decimals, the other decimals are discarded! Likewise when the user is allowed to reduce the number of decimal places to 1 the second decimal will be lost, and even when he increases the number of decimal places back to two it will always remain 0. Play with the attached demo and see what happens when the value of pi is entered into a floatspinedit and you increment and decrement the number of decimals. In my opinion, changing (increasing) the DecimalPlaces property should only be allowed when the user is forced to re-enter already existing values.