You need to sign in to do that
Don't have an account?
jameskCA
Apex method treats numbers without decimals as integers when doing math?
I have a very basic method:
public decimal inverterPerformanceFactor(String inverter){ if(inverter.contains('Enphase')){ return (104.00/100.00); } else{ return (102.00/100.00);} }Without the decimal places, e.g. 102.00 vs 100, the method would always return 1. I'm just curious why that is? Should I always specify a decimal value when doing math in apex?
Example is
Please mark as best answer if repsonse helped you.
Thanks