Have a look at floats and rounding in PHP. Plenty of resources on the net.
Use Mathematical Extensions to solve your problem. For your case you can use BC Math
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community