|
Try this algorithm, ( in a GUI "textfield" )
Before the user inputs, save the current value of textfield on a variable.
in every input, check the last character for decimal and dash
if satisfied, allow and replace the saved value to this new one.
else, remove the text, and replace it with the value that was stored.
kind regards,
sukatoa
|