Get decimal from product price with Mysql
The answer really lays in the first line SELECT post_title, ID, MIN( CAST(wm.meta_value AS UNSIGNED)) AS price – here you cast to UNSIGNED which is integer, and this cuts of your decimal part. So the solution is just replace UNSIGNED with DECIMAL(10,2) or FLOAT And result code will look this way with FLOAT $pts = … Read more