Hướng dẫn php divide without decimal
The thing i want to do is :
I want to divise the number in the most equitable part and the last part to add the difference , exemple :
i want the code for every division how is the best way to do that ? asked Dec 15, 2017 at 12:26
2 Here I have extracted the remainder of the
Output will look like this:
For making variables as you mentioned use:
Jay Blanchard 33.6k16 gold badges73 silver badges113 bronze badges answered Dec 15, 2017 at 12:36
pravindot17pravindot17 1,1651 gold badge15 silver badges31 bronze badges 2 For PHP 7, you can use this function (check comment for <7):
Use it like this:
And the output will be:
answered Dec 15, 2017 at 12:37
FirstOneFirstOne 5,6415 gold badges25 silver badges45 bronze badges A method that does not loop and uses basic PHP functions. I use array_fill to fill the array with the floor of the calculation.
https://3v4l.org/hFrDc answered Dec 15, 2017 at 13:18
AndreasAndreas 23.4k5 gold badges29 silver badges62 bronze badges This is a way to do it using
The result of which will be:
answered Dec 15, 2017 at 13:05
Ivan86Ivan86 5,6372 gold badges13 silver badges30 bronze badges 5 |