Division solution for PHP

Source: Internet
Author: User
About PHP division $ abc = 285083800; $ truit = 10000000; $ abc = $ abc/$ truit; the result is: 28.508379999999998943849277566 instead of: 28.5083800 is a software interface PHP, I don't know what the software has done to get the value accurate to so many decimal places below. how can I tell you about PHP division?
$ Abc = 285083800;
$ Truit = 10000000;

$ Abc = $ abc/$ truit;

The resulting value is: 28.508379999999998943849277566.
Instead of: 28.5083800

It is a software interface PHP, and I don't know what the software has done to get the value accurate to so many decimal places below
How can I write code to set the value to 28.5083800?


Which of the following is the complete code? thank you!

------ Solution --------------------
$ Abc = 285083800;
$ Truit = 10000000;

$ Abc = $ abc/$ truit;


Echo number_format ($ abc, 7 ,'.','');

// 28.5083800

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.