scottopolis / edd-metrics

EDD Metrics
46 stars 12 forks source link

Sanitize the numbers passed to percent_change #43

Closed zackkatz closed 7 years ago

zackkatz commented 7 years ago

This prevents calculations on values that may contain dollar signs and commas.

The get_percentage() method was returning a NaN value, which can't be JSON-encoded. json_encode() was returning JSON_ERROR_INF_OR_NAN. This fixes that, and the broken AJAX request.

Fixes #35

scottopolis commented 7 years ago

Thanks Zack!