Reputation: 177
Is there a way to make sure that numbers are entered into an EditBox in a specific format? ie when someone types 11 it adds a . after it so if someone types 1124 it will recorrect when it gets to the end of the second 1 and adds a . making it 11.24. This is intended for currency. This is made for an TEdit Thanks
Upvotes: 1
Views: 1775
Reputation: 125708
The easiest way is to use a TMaskEdit
for this; it's what it was designed to do.
MaskEdit1.EditMask := '00.00'; // requires two digits before and after
// the decimal point
See the documentation for TEditMask
for more information about the types of mask characters you can use.
Upvotes: 2