扫码关注官方订阅号
ringa_lee
var str='¥2,499.00'; str.replace(/[¥,]/g,''); // => 2499.00
var str = '$2,499.00'; str.match(/[\d.]/g).join('');
如果字符串里面还有其他的字符,这样就可以了
直接这样可以吗 substr("¥2499.00",3);
substr("¥2499.00",3);
("¥2,499,999.00").replace("¥","").replace(/,/g,""); ("¥499,999.00").replace(/[^\d\.]/g,"");
"¥2,499.00".match(/¥([\d,]*?\.00)/)[1] //2499.00 "¥2,99.00".match(/¥([\d,]*?\.00)/)[1] //299
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
如果字符串里面还有其他的字符,这样就可以了
直接这样可以吗
substr("¥2499.00",3);