diff --git a/bower.json b/bower.json index 79245b5..ecef259 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "angular-numeraljs", "author": "Dave Bauman", - "version": "1.0.2", + "version": "1.0.3", "license": "MIT", "main": ["./dist/angular-numeraljs.js"], "repository": { diff --git a/dist/angular-numeraljs.js b/dist/angular-numeraljs.js index 9fb514e..1eb532e 100644 --- a/dist/angular-numeraljs.js +++ b/dist/angular-numeraljs.js @@ -1,23 +1,24 @@ /** * AngularJS filter for Numeral.js: number formatting as a filter - * @version v1.0.2 - 2014-09-16 + * @version v1.0.3 - 2014-09-16 * @link https://github.com/baumandm/angular-numeraljs * @author Dave Bauman * @license MIT License, http://www.opensource.org/licenses/MIT */ /*global numeral */ 'use strict'; + angular.module('ngNumeraljs', []) .filter('numeraljs', function () { return function (input, format, language) { - if (input == null || format == null) + if (!input || !format) { return input; - if (format === '') - return ''; - if (language != null) + } + + if (language) { numeral.language(language); + } - return numeral(input).format(format); }; }); diff --git a/dist/angular-numeraljs.min.js b/dist/angular-numeraljs.min.js index a4733b6..daee87d 100644 --- a/dist/angular-numeraljs.min.js +++ b/dist/angular-numeraljs.min.js @@ -1,8 +1,8 @@ /** * AngularJS filter for Numeral.js: number formatting as a filter - * @version v1.0.2 - 2014-09-16 + * @version v1.0.3 - 2014-09-16 * @link https://github.com/baumandm/angular-numeraljs * @author Dave Bauman * @license MIT License, http://www.opensource.org/licenses/MIT */ -"use strict";angular.module("ngNumeraljs",[]).filter("numeraljs",function(){return function(a,b,c){return null==a||null==b?a:""===b?"":(null!=c&&numeral.language(c),numeral(a).format(b))}}); \ No newline at end of file +"use strict";angular.module("ngNumeraljs",[]).filter("numeraljs",function(){return function(a,b,c){return a&&b?(c&&numeral.language(c),numeral(a).format(b)):a}}); \ No newline at end of file diff --git a/package.json b/package.json index c665aa6..0540b55 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "angular-numeraljs", "description": "AngularJS filter for Numeral.js: number formatting as a filter", - "version": "1.0.2", + "version": "1.0.3", "homepage": "https://github.com/baumandm/angular-numeraljs", "author": "Dave Bauman ", "repository": {