I want to show random products in particular category in my home page, i tried this code http://www.magikcommerce.com/…/random-products-magento-hom…/ It working, but product price have extra 4 digits like : 1900.0000 how to remove last 4 digits can you help me ?

I tried magento default price module it remove last 4 digits, But it repeat single price to all products.

My working website : http://m.machinetoolsemart.com/ Please reply me as soon as possible

  • Thanks for your co-operation, I got a solution. Thanks Magento.stackexchange Commented Apr 11, 2016 at 6:37

1 Answer 1


You need to replace from $displayed_products[$random_products[$i]]->getPrice() to Mage::helper('core')->currency($displayed_products[$random_products[$i]]->getPrice(), true, false);

  • @Vijayakumar can you please tell me reason for accepting another answer while i have answer it first by using your code. anyway I glad to hear that my code is working :)
    – Arunendra
    Commented Apr 11, 2016 at 6:42
  • Sorry for that, i tried Qaisar Satti given codes and your codes, But your code give the result as i expected, But i got your code last 10 min ago. If i got your at earlier i can fix that bug earlier. Anyway Thanks for that. Commented Apr 11, 2016 at 6:46
  • @Vijayakumar if you talking about time then you can see my answer time and his comment time any way thanks for your time
    – Arunendra
    Commented Apr 11, 2016 at 6:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.