Definining function calc-percent()

It was not defined.
Merge pull request #639 from joseluis/patch-6

Definining function calc-percent()