problem doing simple division
in
Programming Questions
•
2 years ago
I cant figure out why the division sign just isnt working. The println shows that the values im dividing are equal 3 and 9 or 4 and 10 but the resulting value is always 0. I'm trying to map a percentage to the gain of an audio player but i cant get the division function to work
- void go(int stampsNumber, int stampTotal_temp){
- vol= ((stampsNumber) / (stampTotal_temp)) * 100;
- println("the stamp number is " + stampsNumber);
- println("the stamp total is " + stampTotal_temp);
- println("the volume is " + vol);
- vol= map(vol, 0, 100,-80,13.97);
- println("finally volume is " + vol);
- music.setGain(vol);
- music.play();
- }
1