Skip to content

Number

The number.py module provides methods for handling integers and float values.

Is Float Convertible

The method is_float_convertible() is designed to check if a given value can be converted to a float, if the conversion is possible it returns a boolean indicating so. Check its implementation below:

from everysk.core.number import is_float_convertible
is_float_convertible('3.14')
True

Below we have another example where a value is not able to be converted to a float:

is_float_convertible('not_a_number')
False