For example, the input is 500, click save, is - 500
CodePudding user response:
This is a mathematical subject,Judgment, greater than zero, is multiplied by 1, or add a minus sign,
CodePudding user response:
String turn numeric types, then take the absolute value, and finally the not, such as:A double value:=- abs (StrToFloatDef (edtInput. Text, 0))