So I have been fiddling around with this trying to get it to put out a float but it won't. Any help would be appreciated.
net = ((float)inc - (inc * tax1)/100);
So I have been fiddling around with this trying to get it to put out a float but it won't. Any help would be appreciated.
net = ((float)inc - (inc * tax1)/100);
first of all , net has to be declared as float at the first place, otherwise the computer will round it down to something else.
second of all, assuming that tax1 is an integer too, it has to be casted as well
three, if inc is not float, it has to be casted in all of it's instances.
so we get
net =((float) inc - ((float) inc * (float) tax1)/100) and making sure that we declared float net; at the start