vue3 element精确小数点后六位
在Vue3 Element中,可以使用toFixed(6)方法将小数点后的位数精确到6位,例如:
<template>
<div>
<p>{{ num.toFixed(6) }}</p>
</div>
</template>
<script>
export default {
data() {
return {
num: 3.14159265358979323846
}
}
}
</script>
上述代码中,num的值为π,使用toFixed(6)方法将其精确到小数点后6位并显示在页面上。
原文地址: http://www.cveoy.top/t/topic/ZMK 著作权归作者所有。请勿转载和采集!