p-variation, calculation and application