I have the following string: $s = '9876543210.12345';
I need to convert this string to a value of a numeric type.
I tried with (int) $s
only it removes the decimal places and returns like this: 9876543210
.
I tried with (float) $s
and it returns me without the last digit like this: 9876543210.1234
.
I also tried using the number_format but the return was of type string
.
How can I convert this value to a numeric type without losing any decimal places?