0

How do you program precentege

I want to calculate some numbers and i cant seem to get it to work the calculation im trying to do is Example 2.548% * (1 - 2.657%) = answer in percent

10th Dec 2016, 1:09 PM
Brudge Kisekka
Brudge Kisekka - avatar
2 RĂ©ponses
+ 1
1% = 0.01, your example: 0.02548 * (1 - 0.02657) = 0.0248029964 0.0248029964 *100 = 2.48029964 result: 2.48029964%
10th Dec 2016, 2:48 PM
codinator
codinator - avatar
0
Oooh ok its that simple but if we say i have a Double nr1 = 5.45; Int nr2 =1; Double nr3 = 1.6544; Double result; result = nr1 * (nr2 - nr3); How do i convert them to 0.0545 from 5.45? If the Double has that value in the beginning?
10th Dec 2016, 2:57 PM
Brudge Kisekka
Brudge Kisekka - avatar