It's not a simple matter to know what the "right" number is. This Excel table
http://www.caltriplecrown.com/ClimbingDoubles.xls of altitude gain readings from California double centuries over many years from many cyclists using a wide variety of devices shows just how much variability there is in raw readings from barometric altimeters, let alone how GPS mapping algorithms decide how big/small an increase must be to qualify as a sufficient change to incorporate into the total gain.