vinsol/spree-loyalty-points — pull request #4 by cbrunsdon (2014-03-31 12:12:34+00:00)
Title: Add a display formatter

Hi!

To start off this PR I'd like to give you a heads up that we're going to be using this extension for a project we're currently working on. So to start off, thanks! We're going to shoot you off a number of PR's to add functionality or more easily extend spree-loyalty-points for the project we're working on. Please feel free to take the ones you want and ignore the ones you don't.

Since we're currently working on spree 2-1, I'm going to send the PR's against stable for now. if you think that any of this is functionality you'd like in master, let me know and I'll get them to cleanly apply to there.

This first PR allows customization of the way points are displayed to end-users. The straight integers weren't enough for us, but with this customization we are able to easily change the way points are displayed to a user. For instance, to make it look more like money, I could do something like:

```ruby
class DecimalPointFormat
def display object, points
::Money.new(points, object.currency).format
end
end
Spree::LoyaltyPoints.loyalty_points_format = DecimalPointFormat.new
```