Calculate percentage change between two values.
The original value
The new value
The percentage change as a Decimal
const pnlPercent = calculatePercentageChange( toDecimal("100"), // original toDecimal("120") // current); // 20 (representing 20%) Copy
const pnlPercent = calculatePercentageChange( toDecimal("100"), // original toDecimal("120") // current); // 20 (representing 20%)
Calculate percentage change between two values.