Closed Thread
Results 1 to 3 of 3

Thread: Rounding using PHP

  1. #1

    Rounding using PHP

    Here's my counter stats:


    Total Visitors: 67897
    Day: Visitors: Views:
    Average 132.66666666667 276
    20010623 45 77
    20010622 224 484
    20010621 129 267


    should be rather obvious why i'd like some rounding

    Either 3, 2, or no decimals (give your comments on which would be best)

  2. #2
    Junior Member Xyzzy is an unknown quantity at this point
    Join Date
    Mar 2001
    Posts
    16
    $number = round($number, $precision);

    Personally I prefer fractions over floating point (e.g. 398/3 instead of 132.6'), but using them would be a bit more work.

  3. #3
    fractions don't seem that hard...

    echo $original . "/" . $divider;

    or ni my case
    $count . "/" . $days;

    anyway, thanks for that function (and the link).

Closed Thread

Bookmarks

Posting Permissions

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