The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

WP eCommerce
[resolved] Zeros add to price when product is saved (5 posts)

  1. sysamurai
    Posted 3 years ago #

    Updating any product, I enter a price without decimals. (1000)

    After saving the changes decimals are added in the display (1000.00)

    Saving again adds the decimals to the integer part (100000.00)

    Saving again adds the decimals to the integeer part again (10000000.00)

    I use WP 3.5 with TwentyTwelve and Swedish language pack. In Sweden a comma is used as decimal delimiter (1000,00). Probably hence the problem.


  2. Jan9292
    Posted 3 years ago #

    I have the same problem!

  3. Marcel Pol
    Posted 3 years ago #

    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.

  4. Justin Sainton
    Plugin Author

    Posted 3 years ago #

    This seems legitimate, if you wouldn't mind posting this to our GitHub issues repo, that would be helpful.


  5. Marcel Pol
    Posted 3 years ago #

    I didn't add a patch, but it might be too simple for that :).


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.