PHP. How to return the correct number of decimal places in the values from the database?

Roads have a table which contains the name and coordinates of the polygon describing it.
The coordinates are in two columns "lat" and "lng" is of type json.
On my PC and the hosting has one and the same website with the same database and data.
When retrieving data from the database to the front the difference in file size can reach 3 times.
Went to check the files and found that in production of coordinates returned with a large number of decimal places, although the locale everything is fine.
Left production right locale.
In the database everything is stored correctly, exactly 6 decimal places.
Sin on php but don't know how to fix it.
How all the same to return the correct data to 6 decimal places?
Thanks in advance!
April 4th 20 at 13:05
1 answer
April 4th 20 at 13:07

Find more questions by tags PHP