Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts

    PHP cant do its maths?

    This is what php tells me.
    99.96 x 1.1 = 108.9
    now my calculator tells me that the answer is 109.956 ... so whats going wrong?
    If I use the numbers then its fine but if I use variables then it loses a bit somewhere.
    Last edited by NancyJ; 05-05-2006 at 11:01 AM.

  • #2
    mio
    mio is offline
    New Coder
    Join Date
    May 2006
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi,

    try with BC extension
    here for more information:
    http://fr.php.net/manual/en/ref.bc.php

    mio

  • #3
    Senior Coder NancyJ's Avatar
    Join Date
    Feb 2005
    Location
    Bradford, UK
    Posts
    3,174
    Thanks
    19
    Thanked 66 Times in 65 Posts
    I cast as float and it seems to be ok now.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •