Convert period to a number