Sha256: 91f6e4f8ac08f57632d8d775f18c344a5b4d915b0e33d9f88de8be013c037b52

Contents?: true

Size: 995 Bytes

Versions: 27

Compression:

Stored size: 995 Bytes

Contents

#= require accounting/accounting

# TODO remove require from sprockets from this file
# TODO manage dependencies through aura, remove dependencies from this define call

'use strict'

# TODO unifiy extension plug-in api
define 'aura/extensions/rivets/accounting', ['aura/extensions/rivets', 'vendor/accounting'], (parent, accounting) ->

  rivets = require 'mikeric-rivets/dist/rivets'

  # ### currency
  # ```data-text="user.accountBalance | currency"```
  #
  # You must include [accounting.js](http://josscrowcroft.github.com/accounting.js/) on your page to use this. It is not bundled.
  #
  # Returns the value currency formatted by accounting.js
  rivets.formatters.currency = (v) -> accounting.formatMoney v

  initialize: (application) ->
    {core} = application

    core.util.extend accounting.settings.currency,
      symbol: 'R$'
      format: '%s %v'
      thousand: '.'
      decimal: ','

    core.util.extend accounting.settings.number,
      thousand: '.'
      decimal: ','

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ende-0.4.25 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.24 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.23 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.22 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.21 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.0 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.20 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.19 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.18 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.17 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.16 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.15 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.14 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.13 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.12 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.11 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.10 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.9 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.8 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.4.7 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee