Sha256: bcdf38b84db41b2e164972a09485ca1430968e8c689cc7b45acd55b3f711a540

Contents?: true

Size: 991 Bytes

Versions: 21

Compression:

Stored size: 991 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@v0.5.12'

  # ### 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

21 entries across 21 versions & 1 rubygems

Version Path
ende-0.5.22 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.21 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.20 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.19 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.18 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.17 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.16 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.15 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.14 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.13 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.12 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.10 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.9 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.8 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.7 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.6 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.5 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.4 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.3 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee
ende-0.5.2 lib/assets/javascripts/aura/extensions/rivets/accounting.js.coffee