Convert a string to a double - is this possible?

前端 未结 4 1618
既然无缘
既然无缘 2020-12-03 04:29

Just wondering in php, if it was possible to convert a string to a double. I am using a financial web service which provides a price as a string. I really need to process th

4条回答
  •  悲&欢浪女
    2020-12-03 04:49

    Why is floatval the best option for financial comparison data? bc functions only accurately turn strings into real numbers.

提交回复
热议问题