When I do this typecasting:
(float) '0.00';
I get 0. How do I get 0.00 and still have the data type as a float?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A float doesn’t have
0or0.00: those are different string representations of the internal (IEEE754) binary format but the float is the same.If you want to express your float as "0.00", you need to format it in a string, using number_format :