I can't set Czech national number formats in /admin/store/settings/store/edit/format.
We use following formats:
Currency: 5 050,50 Kč, -5 050,50 Kč
Weight: 50,5 kg (alternatively 50 505,0 g)
Length: 50,5 cm (alternatively 505,0 mm)
So, instead of decimal point we use decimal comma. As thousand separator we use space.
The problem is that it is not possible to set e.g. weight, length decimal separator to comma in admin. Nor I didn't found it in table variable in database. For more info see http://en.wikipedia.org/wiki/Decimal_separator
There should be following settings:
Decimal separator (for all): {'.', ',', ...}
Thousands separator (for all): {',', '.', '', ' ', ...}
Decimal precision (for currency): {1, 2, 3, 4, ...}
Display currency sign after amount (currency only): {yes, no}
Display space before/after currency sign (currency only): {yes, no}
Where space is said or written (Thousand separator, Space before/after currency sign) it should be displayed as non-breaking space in frontend.
I have to edit node-product.tpl.php to change dot to comma in values in uc_length_format and uc_weight_format. It is not big problem but I also think that it is not a big problem to implement above settings. Maybe I could write a patch. But I'm not very familiar with patches now.
The second problem is that when I use "&nb_sp;Kč" for currency in /cart/checkout i see 14 235,00&nb_sp;Kč. I use non-breaking space because somewhere the price is on three lines (1.line 14(thousands); 2.line 235,00(all between two spaces); 3.line Kč(currency)). I was not successful in setting thousands separator to &nb_sp;
&nb_sp should be read without underscore. It is html entity for non-breaking space.
Comments
Comment #1
cha0s commentedI agree that your proposal is good, I'm changing this issue from a bug report to a feature request though.
Also, I'm pretty sure you're looking for (no underscore) =)
Comment #2
rszrama commentedHmm, I'm not sure HTML entities will be possible... but if they're not, the solution is to use CSS. Figure out the class the numbers are appearing in and use the property
white-space: none;.Comment #3
rszrama commentedComment #4
rszrama commentedComment #5
Island Usurper commentedMy first thought is "number_format() can't handle HTML entities, so we need to use CSS." This lead me to try it by putting a
<span class="formatted-number">wrapper around the outputs of the various format functions. This could work, but there's a lot of code in Ubercart that doesn't expect HTML from uc_currency_format() and runs it through check_plain(). I'm not sure if changing that to something less restrictive is the best course or not, and I'm leery of changing that much code this late anyway.I really wish we could use money_format(), but it's not available on Windows.
Comment #6
rsm08 commentedI have the same problem as thread starter. In Denmark we use decimal point as thousands separator and comma as decimal separator (the exact opposite of United States).
Formatting for display can be dealt with, but when inserting or editing a product node, the form won't validate with anything other than a decimal point as separator.
I hope you'll include Vojtěch's suggested settings in a future update!
Comment #7
tr commentedBumping up to 7.x-3.x for consideration.
Comment #8
hip commentedSubscribing
Comment #9
hip commentedSubscribing. It doesn't fit too many countries decimal separator rules.
Seen that: http://api.ubercart.me/api/drupal/ubercart!uc_store!uc_store.module/func...
Anything to do? (at least to patching it?)
Comment #10
DanZ commentedDon't post to subscribe. Click on the "Follow" button near the top of the page.
Comment #12
tr commentedFixed in 8.x-4.x by commit 25e63c9fceffe4fd5. There doesn't seem to be a whole lot of interest in this, but if someone wants to backport the patch to 7.x-3.x please go ahead and reopen this issue with your patch.