How do I avoid excessive zeroes for numeric fields?
As mustaccio pointed out, this is more of an issue of the displaying of the value on the client side. Your number is originally generated with a lot of unneeded 0s in PHP. The column that stores this data in database has a fixed amount of precision it must adhere to (per its schema definition), so all values are stored in that column with the same precision (and technically normalized with the same amount of 0s). This isn't apparent though until recalled back into the client application. It is the client side that is responsible for formatting.
If you really wanted to avoid this, you could store your results in a VARCHAR column instead and cast your results to a string then use some sort of function in PHP to remove the trailing 0s like RTRIM() or REGEX.
This isn't necessarily recommended from a Normalization standpoint for performance and maintainability reasons, but if you don't need to manipulate these results in SQL or do any aggregation on it after it's stored then it's probably ok.