EVNotify / EVNotifyPWA

PWA Webinterface for EVNotify
7 stars 3 forks source link

simplify chargeDecimalTime #89

Open yankee42 opened 3 years ago

yankee42 commented 3 years ago

I was idling through the source code and than I found this:

((soc === 100) ? 1 : '0.' + ((soc < 10) ? ('0' + parseInt(soc)) : parseInt(soc)))

I stared at it for a while. Not sure if I may be missing something... But... if the purpose is to divide by 100, then I think I know an algorithm which is a little more compact and should also perform quicker with less memory overhead.