mirror of
https://github.com/we-promise/sure.git
synced 2026-08-05 08:32:15 +00:00
Trend#percent divided the delta by the signed previous value, so a negative base inverted the sign of the result and contradicted #direction. This showed an up arrow next to a negative percentage (and vice versa) for anything that can go below zero — most visibly net worth in reports and balance sparklines. Divide by the magnitude of the base instead, and carry the sign of current when the base is zero so an all-negative move reports -Infinity rather than +Infinity. Fixes #2579
1.9 KiB
1.9 KiB