Download & Extend

Remove decimals from price if they are zero

Project:Ubercart
Version:6.x-2.0
Component:Code
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

I'm attaching a patch to include and option to remove the decimals from the price when it is shown if they are zero.

El saludo!

AttachmentSizeStatusTest resultOperations
uc_price_remove_decimals.patch922 bytesIgnored: Check issue status.NoneNone
uc_store_admin_remove_decimals.patch681 bytesIgnored: Check issue status.NoneNone

Comments

#1

I think this is a theming issue and does not belong in Ubercart core. You can format the price how you want using the standard Drupal theming mechanism of overriding theme_uc_product_price(), or you can hook into the Ubercart price formatter.

#2

I know, i've made this before with the hooks but i think this can be useful to lot of people, we use it every time.

What is the difference between this and the currency sign in the left or in the right?

#3

Status:active» closed (won't fix)

Marking as won't fix because this can and should be done in the theme.

#4

Status:closed (won't fix)» active

Hi,
Sorry to open this issue. I don't want to hack core as well. Can anybody help me with theming prices?
I only want to remove the decimals when they are 00. For example 5,00 € should be 5 €, but 5,50 € should remain the same, not 5,5 €.
Thank you very much.

#5

Status:active» closed (won't fix)

I answered that in #1. If you need help using core Drupal theming, I suggest trying the Drupal IRC channels, reading the theming documentation on drupal.org, or reading a book on Drupal.

nobody click here