Judge Vaule is not a number

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.