[英]SimpleCart not allowing thousand comma separator
I am using simplecart. 我正在使用simplecart。 Nice and simple, I have dealt with most of its flaws but this one is bothering me still.
很好而且很简单,我已经解决了它的大多数缺陷,但是这个问题仍然困扰着我。
a price is presented with , as a thousand separator, pretty standard stuff! 价格以千位分隔符的形式提供,非常标准!
EG: $2,456.55 EG:$ 2,456.55
once its added to the cart its added as only 2 This must be the comma. 将其添加到购物车后,仅添加2。这必须是逗号。
I think I have found the offending line: 我想我已经找到了违规行:
_data.price = parseFloat(_data.price.replace(simpleCart.currency().decimal, ".").replace(/[^0-9\.]+/ig, ""));
What should I add to remove any found comma to the REGEX? 我应该添加什么以删除找到的REGEX逗号?
只删除,
这比较简单
replace(/,/, "")
issue not in simplecart. 问题不在单车上。 Its in a presentation script in PHP using floatval without first removing the commas.....
它在使用floatval的PHP演示文稿脚本中,无需先删除逗号.....
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.