7.x-1.x featured an input filter that was removed from 7.x-2.x. Let's add it again.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | currency_1849662_03.patch | 7.22 KB | xano |
| #3 | currency_1849662_02.patch | 4.54 KB | xano |
| #2 | currency_1849662_01-do-not-test.patch | 6.3 KB | xano |
| #1 | currency_1849662_00.patch | 1.73 KB | xano |
Comments
Comment #1
xanoThe attached patch adds the input filter from 7.x-1.x in a slightly improved form: better UI texts, filter tips, and cleaner and more flexible code, altered to use the new conversion API from #1848966: Pluggable currency conversion, on which this patch of course depends.
Comment #2
xanoPatch depends on #1848966: Pluggable currency conversion.
There are now two input filters: one to insert exchange rates, and one to convert amounts from one currency to another. It has tests too.
Comment #3
xanoThere is just one input filter, which converts amounts. If the amount is not given, or if it is 1, then it functions as an exchange rate display.
Comment #4
xanoAmounts need to be parsed using bartfeenstra/currency, and I'd like to add a filter to format/localize currency amounts.
Comment #5
xanoThe patch adds two input filters:
[currency:currency_code_from:currency_code_to],[currency:currency_code_from:currency_code_to:amount]to convert amounts from one currency to another. This filter is identical to the one in 7.x-1.x, with the exception that the amount may be in a localized format.[currency-localize:currency_code:amount]to display an amount in the current locale. This input filter is not cacheable.Comment #6
xanoComment #8
xano