A digital compass is more expensive than an analog compass, but also more accurate due to the fact that a digital compass can adjust for local mineral deposits and other phenomena that an analog model cannot. However, a digital compass must be calibrated when you first buy it and every time you change the batteries. While each make and model varies slightly, there are some general steps you can follow to calibrate your compass in less than 10 minutes.
Find and press the "heading" or "set" button on your digital compass. This button sets up the digital compass for recalibration.
Hold the compass level with the horizon. Make sure that you are not near any metallic or magnetic objects.
Rotate the compass twice slowly (two complete rotations), making sure that the compass remains level to the horizon (direction of rotation does not matter).
Look for the heading your compass should now give you. Set the declination value to 150 degrees by rotating the compass to 150 degrees (or for true north, set the declination value according to the city you live in if you know the value).
Press the "set" or "heading" button again, and your digital compass will finish calibrating for magnetic north (or true north, if you've set your city's or town's declination angle).