提交 8902816f 编写于 作者: linjinyang's avatar linjinyang

app-span 支持表单格式化 更新---fix4

上级 a4e8fb53
...@@ -209,9 +209,14 @@ export default class AppSpan extends Vue { ...@@ -209,9 +209,14 @@ export default class AppSpan extends Vue {
public currencyFormat(){ public currencyFormat(){
let number:any = Number(this.value); let number:any = Number(this.value);
let _unitName = this.unitName?this.unitName:''; let _unitName = this.unitName?this.unitName:'';
if (this.precision){
let _precision = Number(this.precision); let _precision = Number(this.precision);
if(Object.is(this.dataType,"CURRENCY")){
this.text = Number(number.toFixed(_precision)).toLocaleString('en-US')+ ' '+ _unitName; this.text = Number(number.toFixed(_precision)).toLocaleString('en-US')+ ' '+ _unitName;
}else if(Object.is(this.dataType,"FLOAT") || Object.is(this.dataType,"DECIMAL")){
Object.is(this.dataType,"FLOAT") && _precision === 0 && (_precision=2);
this.text = number.toFixed(_precision);
}else {
this.text = this.value;
} }
} }
...@@ -231,7 +236,6 @@ export default class AppSpan extends Vue { ...@@ -231,7 +236,6 @@ export default class AppSpan extends Vue {
} }
} }
} }
} }
</script> </script>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册