Commit 0a5cc243 by 李伟康

修改样式

1 parent 18451f49
...@@ -243,9 +243,11 @@ import NP from 'number-precision' ...@@ -243,9 +243,11 @@ import NP from 'number-precision'
import pointsConfig from './components/pointsConfig.vue' import pointsConfig from './components/pointsConfig.vue'
import importErrDialog from './components/importErrDialog.vue' import importErrDialog from './components/importErrDialog.vue'
const truncateDecimal = (number, decimalPlaces = 2) => { const truncateDecimal = (number, decimalPlaces = 2) => {
let multiplier = Math.pow(10, decimalPlaces), let [integer, decimals] = String(number).split('.')
truncatedNumber = Math.floor(number * multiplier) / multiplier if (!decimals) decimals = '00'
return truncatedNumber.toFixed(decimalPlaces) if (decimals.length > 2) decimals = decimals.substring(0, decimalPlaces)
if (decimals.length == 1) decimals += '0'
return `${integer}.${decimals}`
} }
export default { export default {
components: { components: {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!