Skip to content

Instantly share code, notes, and snippets.

@azami
Created May 20, 2014 01:58
Show Gist options
  • Save azami/cd8171e424e9b44e8d89 to your computer and use it in GitHub Desktop.
Save azami/cd8171e424e9b44e8d89 to your computer and use it in GitHub Desktop.
angularjs filtersの例
filters.filter('belowDecimalPoint', [
function() {
return function(amount, symbol) {
var decimal = ((amount || '').split('.')[1]) || '0';
while (decimal.length < (symbol || 1)) {
decimal += '0';
}
return decimal;
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment