a-input-number设置金额格式,保留2位小数点
作者:互联网
<a-input-number @change="onChange" :defaultValue="20201991.11" placeholder="请输入总金额" :formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')" :parser="value => `${value}`.replace(/\$\s?|(,*)/g, '')" :precision="2" style="width: 100%;" />
:formatter="value => `${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')" :parser="value => `${value}`.replace(/\$\s?|(,*)/g, '')" :precision="2"
标签:style,parser,number,value,replace,小数点,precision,input,formatter 来源: https://www.cnblogs.com/xiadongqing/p/16201196.html