Sha256: eebf23a2b0494b5d3a433178ec1ea464b151c87339f81486cb67b27068bf0a32

Contents?: true

Size: 439 Bytes

Versions: 1

Compression:

Stored size: 439 Bytes

Contents

(function(){
  "use strict";

  App.vue.interfaces.number = {
    methods: {
      _numeral: numeral,
      // checks if the denominator is zero and returns zero
      _safeDivide: function(num, den) {
        if (den === 0) {
          return 0;
        } else {
          // Mult by float ensures that decimals are not stripped like dividing two integers can cause
          return (num * 1.0) / den;
        }
      }
    }
  }

})();

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
codelation_ui-1.0.57 app/assets/javascripts/codelation_ui/std/interfaces/number.js