Text this: A general case of the commutativity degree of nilpotent p-groups of class two