 
                     # trigger final change event
                     triggerChange(elem)
-                
+
                 if isDelete(event) # delete is pressed
                   if elem[0].selectionEnd > elem[0].selectionStart # text is highlighted
                     # get the string before the selection and figure out how many commas it has

            for own option, value of scope.$eval(attrs.smartNumberOptions)
                options[option] = value
        options
    
    isNumber = (val) ->
        !isNaN(parseFloat(val)) && isFinite(val)


            for i in [0...validations.length]
                return false unless validations[i] val, number
            true

    addCommasToInteger = (val) ->
        decimals = `val.indexOf('.') == -1 ? '' : val.replace(/^-?\d+(?=\.)/, '')`
        wholeNumbers = val.replace /(\.\d+)$/, ''
