How do I make something that takes a percentage out of something?
personLvl 62
var y = prompt("divisor");
var x = prompt("dividend");
var outcome = y % x;
textSize(24);
text("when dividing " + (x + (" by " + y)), 100, 170);
text("the outcome is" + outcome, 100, 200);
personLvl 62
idk seems to work for me
- Windows
what.
- Windows
oh yeah what i meant is that- lemme just show you
var percentCalc = 100*1/cost; //turns out, it's just you're average whole number
var cost = 100;
if (bla bla bla) {
cost -= percentCalc //which arises here when the actual thing isnt a percent, instead a whole number
}
personLvl 62
oh i see in that case get a calculator or something
ackvonhuelioLvl 41
pluto
wouldnt it just be
var onePercent = (totalCost/100);
tenPercent = onePercent*10;
Letti42Lvl 6
- Windows
number * 0.1