[英]rounding off to 3 decimal values for the value that uses i18n (regional setting) in vue.js - vue-i18n
I have a method to return the result value,我有一个返回结果值的方法,
---------
const values = 123.10000;
const result = i18n.n(values, 'number');
return result;
--------
In the above,I need to round off the result to 3 decimal point, I tired tofixed, rounD off method but the zeros are not be included in it.在上面,我需要将结果四舍五入到小数点后 3 位,我厌倦了固定,四舍五入的方法,但其中不包含零。
expected output result is 123.100.
预期 output 结果为
123.100.
but i am getting 123.1
, how should i add the decimal round off method to 3 decimal digits with the values having zeros但我得到
123.1
,我应该如何将十进制舍入方法添加到 3 个十进制数字,值为零
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.