AngularJS {{ val | number:1 }} not rounding to 1 decimal place

徘徊边缘 提交于 2019-12-11 03:54:58

问题


<p> <b>{{ x.title }} </b>  Rating:{{ x.rating | number:1}}</p>

The above code is what I'm using. It is getting the value correctly because it is showing an unrounded number (e.g. 3.333333333) so I know the value is passed correctly. Why won't the number:# filter work?


回答1:


I'm an idiot. CLEAR YOUR CACHE KIDS - It was working but hadn't reloaded my index.html file.



来源:https://stackoverflow.com/questions/29421770/angularjs-val-number1-not-rounding-to-1-decimal-place

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!