Home > Back-end >  "' is not a valid float point value
"' is not a valid float point value

Time:10-18



Edit28. Text:=floattostr (strtofloat (leftstr (rightstr (trim (edit27. Text), 8), 5)));

Electronic data for kt from 12.12 kg such intercept the data of normal

Sometimes data for? Or other abnormal string will prompt 'is not a valid float point value or
'? 'is not a valid float point value

How to determine leftstr (rightstr (trim (edit27. Text), 8), 5)) is not obtained when digital exit;

If -- -- -- -- -- - then the exit;

CodePudding user response:

Through regular pick up

CodePudding user response:

TryStrToFloat (const S: a string; The out Value: Extended) : Boolean;

CodePudding user response:

Try
Edit28. Text:=floattostr (strtofloat (leftstr (rightstr (trim (edit27. Text), 8), 5)));
Except,
Edit28. Text:=' ';
end;

Or directly to weight with the show

Edit28. Text:=leftstr (rightstr (trim (edit27. Text), 8), 5);

CodePudding user response:

strtofloatdef

CodePudding user response:

refer to the second floor ZBDZJX response:
TryStrToFloat (const S: a string; The out Value: Extended) : Boolean;


useful

CodePudding user response:

Var
I: LongInt;
F: Double;
Str: string;

The begin
If not TryStrToInt (leftstr (rightstr (trim (Str), 8), 5), I) or not TryStrToFloat (leftstr (rightstr (trim (Str), 8), 5), f) then the exit;

So why not?

CodePudding user response:

The parameter types do not match.

Take a closer look at TryStrToInt and TryStrToFloat function description

CodePudding user response:

refer to 6th floor bruceoffice response:
var
I: LongInt;
F: Double;
Str: string;

The begin
If not TryStrToInt (leftstr (rightstr (trim (Str), 8), 5), I) or not TryStrToFloat (leftstr (rightstr (trim (Str), 8), 5), f) then the exit;
.


This can, want to Use StrUtils

CodePudding user response:

Kt 12.12 kg you thinking a bit problem, if the data is 12.12 this five, your results should be correct, but problems into 120.12,
So you can completely change the way of thinking, kt must be in the front, and determine the two kg must be in the back, and determine the 2, resulting in the middle data section, you will surely write
Finally use the strtofloatdef (' ', 0), in one thousand,
  • Related