Reviewed & tested by the community
Project:
UC Variable Price
Version:
6.x-1.0-rc3
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Mar 2011 at 17:26 UTC
Updated:
4 May 2011 at 15:27 UTC
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.
| Comment | File | Size | Author |
|---|---|---|---|
| varprice_currency_acceptance.patch | 922 bytes | ob3ron |
Comments
Comment #1
ldpm commentedI 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.