Creating a function to calculate percentage from two values