我正在學習angularjs的過程,所以這個問題進入我的腦海。以格式過濾元素
{{val | number:2}}
這導致的數值要像30.12
小數部分爲2但是,試圖在$範圍同樣的事情,我不能讓這樣的。
$scope.example = $filter('bhojendra')('uppercase');//BHOJENDRA
$scope.val = $filter(30.12343)('number:2');//don't work
$scope.foo = $filter(30.12334)('currency');//$30.12334
$scope.foo = $filter(30.12334)('currency:"EUR"');//don't work
https://docs.angularjs.org/api/ng/filter/currency - '$ ('currency')(amount,symbol,fractionSize)' – tymeJV 2014-12-13 07:06:49