code: function zFloat() {
          return {
              restrict: 'A',
              require: 'ngModel',
  
              link: function(scope, elm, attr, ngModelCtrl) {
                  if (attr.type === 'radio' || attr.type === 'checkbox') return;
                  ngModelCtrl.$formatters.push(equivalenceFormatter);
  
                  function equivalenceFormatter(modelValue){
                     var viewValue = ngModelCtrl.$viewValue // could have used 'elm.val()'
                     return (+viewValue === +modelValue) ? viewValue : modelValue;
                  }
              }
          };
      }
docs: * IMPLEMENTATION ** /* Breeze Float Equivalence directive
  
  Adds a formatter to the ngModel controller.
  This formatter returns the view value rather than the model property value
  if the two values are deemed equivalent.
  
  For explanation and more info, see
  http://www.breezejs.com/breeze-labs/breezedirectivesfloat
  
  Install
  --------------------------------------------------
  
  Make this module a dependency of your app module:
  var app = angular.module('app', ['breeze.directives']);
  
  Add the directive to an input tag bound to a floating point property
  <input data-ng-model='vm.product.unitPrice' data-z-float />