constgetEvolutionRateMessage=(before,after)=>{constevolution=before==0?after*100:after==0?-before*100:Math.round((after-before)/before*100)returnevolution==0?"No evolution.":evolution>0?`A positive evolution of ${evolution}℅.`:`A negative evolution of ${Math.abs(evolution)}%.`}
Some JavaScript.
Hi there, nice and short solution! I believe the case for the values
0
&27.35
wont give what you expected. But you are in the right path for sure.Fixed!