(oldValue, newValue)
| 21 | * @returns {string} Formatted percentage |
| 22 | */ |
| 23 | const formatPercent = (oldValue, newValue) => { |
| 24 | const percent = (((newValue - oldValue) / oldValue) * 100).toFixed(2); |
| 25 | return `${percent > 0 ? '+' : ''}${percent}%`; |
| 26 | }; |
| 27 | |
| 28 | /** |
| 29 | * Categorizes asset changes |