二手车交易,行驶公里保留一位小数
This commit is contained in:
@ -196,8 +196,8 @@ export default {
|
||||
let result = (num / 10000).toString();
|
||||
if (result.includes('.')) {
|
||||
let decimalPart = result.split('.')[1];
|
||||
if (decimalPart.length > 2) {
|
||||
result = parseFloat(result).toFixed(2);
|
||||
if (decimalPart.length > 1) {
|
||||
result = parseFloat(result).toFixed(1);
|
||||
}
|
||||
}
|
||||
return result + '万';
|
||||
|
||||
Reference in New Issue
Block a user