Upgrade to Panther but always 99%

Discussion in 'Mac OS X 10.3 (Panther) Discussion' started by SLJ, Nov 7, 2003.

  1. SLJ macrumors regular

    SLJ

    Joined:
    Jul 23, 2003
    Location:
    Australia
    #1
    ever since when I upgrade to Panther, my powerbook 12" rev.A never able to charge the battery to 100% always stop at 99% strange thing is, sometimes the battery does not get charge at 94% as well... anything believe there is problem with my battery or my power managment...
     
  2. Frisco macrumors 68020

    Joined:
    Sep 24, 2002
    Location:
    Utopia
    #2
    My Ti Powerbook only charges to 99% after the upgrade.

    I am going to try to reset the PRAM and PMU
     
  3. bankshot macrumors 65816

    bankshot

    Joined:
    Jan 23, 2003
    Location:
    Southern California
    #3
    I'm pretty sure it's just a rounding/truncating error in the routine that calculates the percentage shown. In Jaguar, 99.5% and above was rounded UP to 100%. In Panther, the decimal portion is truncated. So even 99.999% will still show 99%.

    I wrote a little perl script to show the battery charge from the command line. It always agreed with the percentage shown in Jaguar, and it's now often 1% higher than what's shown in Panther.

    Code:
    #!/usr/bin/perl
    
    if (open(BATT, "/usr/sbin/ioreg -p IODeviceTree -n battery -w 0|")) {
      while (<BATT>) {
        if (/Battery.*"Capacity"=(\d+),.*"Current"=(\d+)/) {
          $cur = $2 + 0.0;
          $cap = $1 + 0.0;
          $pct = int(($cur * 100.0 / $cap) + 0.5);
          print "$pct%\n";
        }
      }
      close(BATT);
    }
    
     
  4. Frisco macrumors 68020

    Joined:
    Sep 24, 2002
    Location:
    Utopia
  5. RichP macrumors 68000

    RichP

    Joined:
    Jun 30, 2003
    Location:
    Motor City
    #5
    interesting response; i have the same 99%, 94% thing too.
     
  6. huntsman macrumors member

    Joined:
    Oct 26, 2003
    Location:
    Australia
    #6
    My battery indicator only ever reached 99% too since I got my iBook G4 last week (Panther pre-installed). But after glancing at it a second ago, it appears to have finally reached 100%. Strange.
     

Share This Page