Firstly poor of my mathematica. I tried to use php to make a number to Multiples of 7. the rules as below:
$num >=0;
$num = '0'; => output '7'
$num = '1'; => output '7'
$num = '6'; => output '7'
$num = '8'; => output '14'
$num = '14'; => output '14'
$num = '16'; => output '21'
$num = '20'; => output '21'
$num = '40'; => output '42'
$num = '84'; => output '84'
...
I cost many times, but I am not smart to solve this by myself. such as
echo round(($num*7-1)/7); // not a right answer.
any one is kindly help me? Thanks.
Your requirements are not consistent if the output for 0 is 7; 0 is already a multiple of 7, since 0 * 7 = 0.
Alternatively, use the modulus operator: