The little battery icon in the taskbar at the upper right of the iPhone screen is okay at giving a rough indication of battery life remaining. Unfortunately when it comes to details the icon is not so useful.
Luckily there are ways to display the exact percentage of power remaining on your iPhone battery. There are two different methods you can use to achieve this goal depending on your iPhone hardware.
Apple has included this feature in iPhone OS 3.0 for users with the iPhone 3GS. To turn on the battery percentage indicator touch Settings -> General -> Usage -> Battery Percentage -> ON.
These menus will only appear on the iPhone 3GS hardware. If you have iPhone OS 3.0 on an older iPhone there's still a way to make this happen.
First, the iPhone you would like to see battery percentage on must be jailbroken. If this applies to you, then simply install SBSettings from Cydia. This application will give you the power to turn on the battery percentage in the taskbar.
After SBSettings is installed, swipe on the taskbar to bring up your toggles and touch the More button. Select Extras & Options at the bottom of the screen. Turn Numeric Battery ON. Click the home button and your battery percentage will appear.
Now you too can freak out looking for a power outlet when your battery is down to 3% remaining!