Posted by arvana on March 27, 2011 at 5:26pm
2 followers
Jump to:
| Project: | UC Variable Price |
| Version: | 6.x-1.0-rc3 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | reviewed & tested by the community |
Issue Summary
Varprice accepts user-entered data for a product price. There is a problem though: there are many ways that people format currency in different parts of the world. For example, comma vs period as the decimal delimiter, and comma or period as thousands separator. Also users might easily add a currency symbol.
This patch makes the module as forgiving as possible to user-entered price data. It strips all non-numeric characters from the entered price except comma and period, then converts it to a plain decimal number regardless of the number format it was entered in.
| Attachment | Size |
|---|---|
| varprice_currency_acceptance.patch | 922 bytes |
Comments
#1
I can't guarantee that I found all of the possible combinations of commas and periods that are legitimate styles somewhere in the world, but this works as expected.