Commit 0a5cc243 by 李伟康

修改样式

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