Move the percent up by double if you want to put off buying a battery. Sorry, but this one has been discussed to no end so I'll offer the quick work around and stop here.
It started a few weeks ago. I have Windows 7 and it is set to alert me at 15% battery and hibernate at 10%, but it has started shutting down completely when not plugged in, sometimes at 30 or 40 percent battery left.
I did a battery check, which said that everything is fine.
The laptop and battery are about a year and a half old.