Uploaded image for project: 'Couchbase PHP client library'
  1. Couchbase PHP client library
  2. PCBC-219

Floating point error in PHP Couchbase Library 1.1

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 1.1.4, 1.2.2
    • 1.1.2
    • library
    • Security Level: Public
    • None

    Description

      --------------
      $value = 50.00;
      $couchbase->set('testvalue',$value,300);
      echo "getting value now... ";
      var_dump($couchbase->get('testvalue'));
      -------------
      float(5011)
      Not 50.00.

      Diving into the couchbase console, it is stored correctly. Something is wrong with the get method coming out of the PHP extension.
      This is happening on any 2 decimal number with .00 as the extension. Caught this in an ecommerce application ... needless to say $ impact of giving someone $5011 instead of $50.00 is damaging.
      Can anyone confirm this behavior in their environments?

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            trond Trond Norbye
            trond Trond Norbye
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty