Create javascript for calculating percent siving