Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

SLJ

macrumors regular
Original poster
Jul 23, 2003
230
2
Australia
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...
 

bankshot

macrumors 65816
Jan 23, 2003
1,367
416
Southern California
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);
}
 

huntsman

macrumors member
Oct 26, 2003
48
0
Australia
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.