Zabbix has multiple functions to check whether string contains a float and several functions to convert string to double. Results of it are really weird.
Calculated item with expression count(float.trapper,#10,.) will count zeros because is_double_suffix() treats "." as a valid number and str2double() than converts it using atof() which cannot return errors.
Calculated item with expression count(float.trapper,#10,+1) will fail to count anything. In 3.0 it will always return 0, in current trunk it will return a visible error. That's because is_double_suffix() rejects numbers starting with plus.
is_double_suffix() is used in trigger function count() and for user macro resolving in trigger and calculated item expressions. is_double correctly says that "." is not a number and numbers starting with plus sign are OK.
The consequences of performing
in set_result_type() and get_result_dbl_value() are that one can do so:
and Zabbix will store -3.0 in database.
This affects all checks using text to double conversion at some point: user parameters, external scripts, etc. with type Numeric (float).
There should be one function to validate and optionally convert string containing a decimal number (possibly surrounded by whitespace, possibly quoted, possibly with plus or minus, possibly with exponent or suffixes).