Sha256: 1be3d5cee12287493ed32336fcef9fd5646c2d0266bfe0517e0599832e504d23

Contents?: true

Size: 472 Bytes

Versions: 68

Compression:

Stored size: 472 Bytes

Contents

@to_currency = ( number ) ->
  unless isNaN number
    (Math.round( parseFloat( number ) * 100 ) / 100).toFixed(2)
  else
    (0).toFixed(2)

@to_euro = (number) ->
  "#{to_currency(number)} €"

@to_dollar = (number) ->
  "$ #{to_currency(number)}"


$ ->
  
  # replace komma with dot (german uses komma instead of dot)
  $("body").on "keyup", "input.number_field", ->
    if jQuery(@).val().indexOf(",") isnt -1
      jQuery(@).val( jQuery(@).val().replace(',','.')  )

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
magic_stylez-0.0.0.26 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.25 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.24 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.23 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.22 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.21 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.20 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.19 vendor/assets/javascripts/magic/helper.js.coffee