Thread: PHP bcdiv()

  1. #1
    Unregistered
    Guest

    PHP bcdiv()

    I wrote a script that polls people and it uses bcdiv() to find the decimal after dividing the number of votes for and item by the total number of votes then using str_replace to remove the 0. from the beginning of the percent. I know this is a round about way of doing this but it works fine on my windows box but when I put it up on my server (redhat) with a version of php that is higher than 4.0.0 and acording to the php manual is new enough I get:
    Fatal error: Call to undefined function: bcdiv() in /www/htdocs/server.php on line 170
    Is there a setting in php.ini I need to change? Or is there just some other way I can figure the percentage?

    Thank You

  2. #2
    Try using the number_format() function.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. combining c php and mysql
    By Thoth in forum C Programming
    Replies: 2
    Last Post: 01-30-2009, 10:55 AM
  2. PHP installation
    By ssharish2005 in forum Tech Board
    Replies: 8
    Last Post: 11-23-2007, 09:42 PM
  3. PHP on my Computer!
    By xxxrugby in forum Tech Board
    Replies: 4
    Last Post: 03-15-2005, 09:34 AM
  4. C++ and PHP communication
    By Korhedron in forum Game Programming
    Replies: 4
    Last Post: 01-12-2004, 06:37 AM
  5. PHP 4.3.0 released
    By codingmaster in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-30-2002, 07:40 AM