Results 1 to 4 of 4

Thread: How can I prevent users from entering characters in price?

  1. #1
    Thread Starter
    Veteran harry0013's Avatar
    Join Date
    Mar 2012
    Location
    Philippines
    Posts
    351
    Thanks
    5
    Thanked 4 Times in 4 Posts

    How can I prevent users from entering characters in price?

    How to format price 0 to show as 0.00 in ads. I tried below lines but when users enters 0 it still show as 0 in ads?

    $price_out = preg_replace("[^0-9.]", "", $price_out);
    $price_out = number_format($price_out, 2, '.', ',');
    $price_out = cp_pos_currency($price_out);

  2. #2
    samcy's Avatar
    Join Date
    Mar 2012
    Location
    Germany
    Posts
    12,098
    Thanks
    121
    Thanked 1,756 Times in 1,442 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!
    Rolf Hassel (Samcy)

  3. #3
    Thread Starter
    Veteran harry0013's Avatar
    Join Date
    Mar 2012
    Location
    Philippines
    Posts
    351
    Thanks
    5
    Thanked 4 Times in 4 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    Thread Starter
    Veteran harry0013's Avatar
    Join Date
    Mar 2012
    Location
    Philippines
    Posts
    351
    Thanks
    5
    Thanked 4 Times in 4 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Limiting the number of characters in the price field?
    By pets4u in forum ClassiPress General Discussion
    Replies: 3
    Last Post: May 31st, 2012, 09:32 AM
  2. Prevent users to post URL in custom fields
    By malioglasi in forum Report ClassiPress Bugs
    Replies: 6
    Last Post: May 27th, 2012, 03:52 PM
  3. How to prevent users from using HTML in ads?
    By malioglasi in forum Report ClassiPress Bugs
    Replies: 12
    Last Post: August 25th, 2011, 05:43 AM
  4. What happened to users entering own password at registration?
    By jlei1989 in forum ClassiPress General Discussion
    Replies: 3
    Last Post: July 3rd, 2011, 10:51 PM
  5. limit number of characters in Price tag
    By dmask in forum ClassiPress General Discussion
    Replies: 1
    Last Post: January 15th, 2011, 12:37 AM