Zeros add to price when product is saved #363

MPolleke opened this Issue Apr 29, 2013 · 3 comments


None yet

3 participants


When using "." for 1000's and "," for decimals, the price gets changed when publishing or updating the post/product. It adds the 2 decimal zeros to the price. So 1780.00 becomes 178000.00

I think a small bug slipped through. What I did was change one line in wpsc-include/currency.helpers.php
In the function wpsc_string_to_float() change this line:
$string = preg_replace( '/[^0-9\' . $decimal_separator . ']/', '', $string );
To this line:
$string = preg_replace( '/[^0-9\' . $decimal_separator . ']/', '.', $string );
It should not remove the "," but replace it with a "."

This seems to work for me.


@garyc40 garyc40 was assigned Apr 29, 2013
WP e-Commerce Plugin member

Do you know what version of WPeC you were running @MPolleke?

I got this response from Gary about this (and his commit seems to reflect code that is newer that what you've described in this ticket)


If you can, review those commits/issues/PRs and let us know if an updated (3.8.10) version works for you. Closing pending further feedback.


I'm sorry, I missed that completely. I just checked the changelog of 3.8.10 and saw the same currency.helpers.php line. I was using, but saw no mention in the changelog of 3.8.10. I should have tested that first anyway.

I just used 3.8.10, and it's working fine for me.
Thank you and Gary.

WP e-Commerce Plugin member

Glad to hear it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment