Calculate the percentage change from yesterday's value to today's value.
Formula: ((todayValue - yesterdayValue) / yesterdayValue) * 100
Positive result — value grew, negative — value dropped.
percentValue(100, 105); // 5percentValue(100, 95); // -5 Copy
percentValue(100, 105); // 5percentValue(100, 95); // -5
The value from yesterday (base of comparison).
The value from today.
The percentage change from yesterday to today (e.g. 5 for +5%).
Calculate the percentage change from yesterday's value to today's value.
Formula: ((todayValue - yesterdayValue) / yesterdayValue) * 100
Positive result — value grew, negative — value dropped.
Example