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"

  

posted @ 2022-04-27 23:53  夏冬青  阅读(2018)  评论(0编辑  收藏  举报