Simple example of converting JS numbers to capital amounts
function DX(n) { if (!/^(0|[1-9]/d*)(/./d+)?$/.test(n)) return "Data illegal"; var unit = "100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 unit.charAt(i); return str.replace(/zero(thousand|hundred|select|corner)/g, "zero").replace(/(zero)+/g, "zero").replace(/zero(ten thousand|billion|yuan)/g, "$1").replace(/(billion) ten thousand|one(select)/g, "$1$2").replace(/^大发发?|小发发发, "").replace(/yuan$/g, "yuan发发发");}The above simple example of converting JS numbers into capital amounts is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.