7.x-1.x featured an input filter that was removed from 7.x-2.x. Let's add it again.

Comments

xano’s picture

Status: Active » Needs review
Issue tags: +Needs tests
StatusFileSize
new1.73 KB

The 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.

xano’s picture

Title: Currency conversion input filter » Input filters
Issue tags: -Needs tests
StatusFileSize
new6.3 KB

Patch 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.

xano’s picture

StatusFileSize
new4.54 KB

There 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.

xano’s picture

Status: Needs review » Needs work

Amounts need to be parsed using bartfeenstra/currency, and I'd like to add a filter to format/localize currency amounts.

xano’s picture

Status: Needs work » Needs review
StatusFileSize
new7.22 KB

The 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.
xano’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

xano’s picture

Assigned: xano » Unassigned