如何与角度考虑带过滤器没有拿到分数多少?我的意思是像1.777我想输出1(角使得这2)如何全面浮点数下来!myvalue的是1.777myvalue的|数量:0结果输出将是2如何进行的:1?
how get number with no fraction in angular in view with filter? i mean like 1.777 i want to output 1 (angular makes that 2) how round float number down! myvalue is 1.777 myvalue| number:0 the output will be 2 how approach to 1?
像parseInt函数jQuery中,我需要考虑????有过滤器角的!
something like parseInt in jquery i need in view???? is there filter in angular that !
这应该是简单的 {{number_ex pression |编号:fractionSize}}
标记
<h6>flight duration: {{item.travelTime | number: 0}}</h6></div>
看 号码过滤器API
更新
有关决策的轮数,那么你需要使用数量
过滤器自定义过滤器内。
For making round number then you need to use number
filter inside your custom filter.
标记
<h6>flight duration: {{item.travelTime | numberFormat: 0}}</h6></div>
过滤器
app.filter('numberFormat', function($filter){
return function(value, fractionSize){
if(value){
$filter('number')(Math.round(value), fractionSize)
}
}
})
上一篇:错误在Internet Explorer中初始化Rangy.js初始化、错误、Internet、Explorer
下一篇:$ SCE:ITYPE试图在需要字符串内容信任一个非字符串值:上下文背景:resourceUrl上下文、字符串、背景、字符串值