在Angular4中,十进制管道或圆形管道不起作用

时间:2018-03-26 16:35:23

标签: angular decimal rounding

我只是想实现这个计算:

{{(this.buyForm.value.rate * this.buyForm.value.Units)}}

现在,rate会有小数位的值,比如0.00003095 * 0.03004。

现在有了乘法,我想用8个小数点来控制它。

我尝试使用十进制管道:

{{(this.buyForm.value.rate * this.buyForm.value.Units)|number:'1.8-8'}}

{{(this.buyForm.value.rate * this.buyForm.value.Units)|round}}但我的情况没有任何效果。

1 个答案:

答案 0 :(得分:3)

您无需添加get(res){ const submitEndpoint = res.submitStepLink; const method = res.method; const req = new HttpRequest(method, submitEndpoint, '', { }); return this.http.request(req) .retry(3); } 来绑定HTML模板中的属性:

尝试

this

而不是

{{(buyForm.value.rate * buyForm.value.Units)|number:'1.8-8'}}

相关问题