The documentation says:
Use TryStrToFloat to convert the string S to a floating point value. S must consist of an optional sign (+ or -), a string of digits with an optional decimal point, and an optional mantissa. Mantissa consists of an āEā or āeā followed by an optional sign (+ or -) and an integer. Leading and trailing spaces are ignored.
Your entry does not meet the conditions and therefore should be considered as an error.
You did not say so explicitly, but I assume that you are claiming that:
TryStrToFloat('21e', val)
returns True . If so, this is a bug that should be reported to Embarcadero. If you need to get around this, I suggest you create your own function that detects this case and processes it correctly.
On the other hand, if this function call returns False , the function behaves as designed, and your error is to read the value in val .
Update
I can confirm that TryStrToFloat('21e', val) returns True . I tested the XE7 update 1. I sent the following Embarcadero error report: https://quality.embarcadero.com/browse/RSP-9814
source share