i am making a cricket stats page and in 1 over there are 6 balls, however if i put in 0.7 id dose not make it 1.1, how can i use php to make it do this?
This is all the code i have got (im using mysql):
<?php echo $row['o'] ?>
i am making a cricket stats page and in 1 over there are 6 balls, however if i put in 0.7 id dose not make it 1.1, how can i use php to make it do this?
This is all the code i have got (im using mysql):
<?php echo $row['o'] ?>
Disclaimer: Please provide code to help people know what you have done, what is not working and what you want. But since I love Cricket, you need to do something like below. Giving C# code since you did not provide your initial PHP code.
Use equivalent PHP code:
will give you "2.2" Also 5 balls comes out as 0.5 which is what you want as well.
But you might want to use an integer input (the number of balls bowled) rather than a decimal value.
This logic can be simplified using the % modulus operator, but I've shown it longhand to try and help you understand the principle