As of v1.2.3, the Currency fieldtype doesn't override the filter method available via Statamic's Fieldtype class. Instead, it's using the default, which is just a standard filter intended for simple text comparisons/queries. That doesn't play nicely with the numeric values returned by the Currency fieldtype. Here's what that currently looks like, on a collection's list view in the CP:
Before
This PR introduces a new, custom filter that's specific to the Currency fieldtype, but inherits the majority of its functionality from Statamic's underlying number filter. That filter has all the basic nuts and bolts needed for numeric filtering—we just add a small check on top of the apply method, to account for subunit storage by updating the searched value, if/when it's enabled. Here's how things look, with this update applied:
After
Let me know if we need to tweak anything else, here—hope you're having a great week, Dominik!
As of v1.2.3, the
Currency
fieldtype doesn't override thefilter
method available via Statamic'sFieldtype
class. Instead, it's using the default, which is just a standard filter intended for simple text comparisons/queries. That doesn't play nicely with the numeric values returned by theCurrency
fieldtype. Here's what that currently looks like, on a collection's list view in the CP:Before
This PR introduces a new, custom filter that's specific to the
Currency
fieldtype, but inherits the majority of its functionality from Statamic's underlying number filter. That filter has all the basic nuts and bolts needed for numeric filtering—we just add a small check on top of theapply
method, to account for subunit storage by updating the searchedvalue
, if/when it's enabled. Here's how things look, with this update applied:After
Let me know if we need to tweak anything else, here—hope you're having a great week, Dominik!