如何解决如何将客户表antd formatNumber
https://ant.design/components/table/
我想使用antd表将数字转换为货币。与这个示例一致,我很困惑,请帮助我,因为我必须在毕业前提交最后一个项目,所以请赶紧。
const timeConverter = rawDate => moment(rawDate).tz(“ Thai / Bangkok”)。format('L');
const { pagination } = this.props;
const columns = [
{
title: "ID",dataIndex: "id",align: "center",width: "60px",height: "30px",},{
title:"วันที่บันทึก",dataIndex:"createdAt",align:"center",width:"200",format:"0,0",render: createdAt => timeConverter(createdAt)
},{
title:"อ้างอิงใบเสร็จเลขที่ ",dataIndex:"re_reference",width:"200"
},{
title:"ชื่อบริการ/สินค้า",dataIndex:"re_pro_name",width:"350",{
title:"รายละเอียด",dataIndex:"re_detail",width:"100",{
title:"รหัสสมาชิก (ถ้ามี)",dataIndex:"re_cus_name",{
title:"ประเภทรับ-จ่าย",dataIndex:"re_type",{
title:"ราคาต่อหน่วย",dataIndex:"re_price",width:"300",// render: re_price => numeral('$0,0.00')(re_price)
render:(text,record) => (
<span> </span>
)
},
解决方法
render:value => ${value}.00
。replace(/ \ B(?=(\ d {3})+(?!\ d))/ g,',')//转换数字monney
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。