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.68 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.67 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.66 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.65 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.64 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.63 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.62 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.61 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.60 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.59 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.58 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.57 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.56 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.55 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.54 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.53 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.52 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.51 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.50 vendor/assets/javascripts/magic/helper.js.coffee
magic_stylez-0.0.0.49 vendor/assets/javascripts/magic/helper.js.coffee