AngularJS货币过滤器代码
html代码:
<body ng-app="AngularcurrencyApp">
<div ng-controller="currencyctrl">
Enter Number: <input type="text" ng-model="sampleval" /><br /><br />
Default Currency expression:{{sampleval | currency}}<br /><br />
Currency with Custom Value: {{sampleval | currency : "USD$"}} <br /><br />
Currency with Zero Decimals: {{sampleval | currency : "USD$" : 0}}
</div>
</body>
JavaScript代码:
<script>
var app = angular.module("AngularcurrencyApp", []);
app.controller("currencyctrl", function ($scope) {
$scope.sampleval = 52343.1435784;
});
</script>