 
                     # trigger final change event
                     triggerChange(elem)
-              
+
             elem.on 'keypress', (event) ->
               killEvent(event)
 

      inertKeys.indexOf(which) >= 0

    invalidInput = (elem, event) ->
      invalidKey(event) or invalidZero(elem, event)

    # invalid actions
    invalidKey = (event) ->
      isNotDigit(event.which) && isNotControlKey(event.which)

    invalidZero = (elem, event) ->
      # entering 0 in the first place
      elem[0].selectionStart == 0 and event.which == 48 

    maxDigitsReached = (elem, maxDigits) ->
      elem.val().length >= maxDigits

            for own option, value of scope.$eval(attrs.smartNumberOptions)
                options[option] = value
        options

    isNumber = (val) ->
        !isNaN(parseFloat(val)) && isFinite(val)

