迁移 formatMoney 和 formatPercent 到 unify
This commit is contained in:
@@ -93,6 +93,14 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
formatMoney(value, decimal){
|
||||
return Number(value).toFixed(decimal||2)
|
||||
},
|
||||
|
||||
formatPercent(value, decimal){
|
||||
return `${Number(value*100).toFixed(decimal||2)}%`
|
||||
},
|
||||
|
||||
formatDate(date, format){
|
||||
if (!(date instanceof Date)){
|
||||
date = new Date(date)
|
||||
|
||||
Reference in New Issue
Block a user