function Isnumberic (vaule:string): Boolean; Judge Vaule is not a number
Var
I:integer;
Begin
Result:=true; Set the return value to Yes (true)
Vaule:=trim (Vaule); Go to Space
For i:=1 to Length (vaule) do//Prepare loop
Begin
If not (Vaule[i] in [' 0 ' ... ' 9 '] then//if the first word of vaule is not any of the 0-9
Begin
Result:=false; Return value is not (false)
Exit Exit function
End
End
End
function Isuppercase (vaule:string): Boolean; Determine if Vaule is a capital letter
Var
I:integer;
Begin
Result:=true; Set the return value to Yes
Vaule:=trim (Vaule); Go to Space
For i:=1 to Length (vaule) do//Prepare loop
Begin
If not (Vaule[i] in [' A ' ... ' Z ']) then//if the first word of vaule is not any of the A-Z
Begin
Result:=false; The return value is not
Exit Exit function
End
End
End
function Islowercase (vaule:string): Boolean; Determine if vaule is not a lowercase letter
Var
I:integer;
Begin
Result:=true; Set the return value to Yes
Vaule:=trim (Vaule); Go to Space
For i:=1 to Length (vaule) do//Prepare loop
Begin
If not (Vaule[i] in [' A ' ... ' Z ']) then//if the first word of vaule is not any of the A-Z
Begin
Result:=false; The return value is not
Exit Exit function
End
End
End
And if you want to judge if it's a letter,
function Isencase (vaule:string): boolean; Judge Vaule is not a letter
Var
I:integer;
Begin
Result:=true; Set the return value to Yes
Vaule:=trim (Vaule); Go to Space
For i:=1 to Length (vaule) do//Prepare loop
Begin
if (not (vaule[i) in [' A ' ... ' Z '])) or
(Not (vaule[i] in [' A ' ... ') Z ']) then//if the vaule word "I" is not a-Z or any of a-Z
Begin
Result:=false; The return value is not
Exit Exit function
End
End
End
In the online finally hunted to a master algorithm, we share the following:
function Roundfloat (f:double;i:integer):d ouble;
Var
s:string;
ef:extended;
Begin
S:= ' #. ' + Stringofchar (' 0 ', i);
Ef:=strtofloat (Floattostr (f));//Prevent errors in floating-point arithmetic
Result:=strtofloat (Formatfloat (S,EF));
End
Judge Vaule is not a number