These are floats , not integers . Integers do not have decimal points.
To answer your question, you can simply typecast strings directly, the conversion will disable units, since they are not numeric characters:
$string = "1.70 m"; $float = (float) $string;
source share