Results 1 to 4 of 4

Thread: Additional numbers after decimal point

  1. #1
    Thread Starter
    iridin's Avatar
    Join Date
    Aug 2009
    Location
    Malta
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Additional numbers after decimal point

    Hello, looking for some help regarding numbers after decimal point.

    I tried to use an instruction I already found in the forums here editing: includes/functions.php:
    ---

    function cp_price_format( $price ) {
    global $cp_options;


    if ( is_numeric( $price ) ) {
    $decimals = ( $cp_options->hide_decimals || $price == 0 ) ? 0 : 8;
    $decimal_separator = $cp_options->decimal_separator;
    $thousands_separator = $cp_options->thousands_separator;


    $price = number_format( $price, $decimals, $decimal_separator, $thousands_separator );
    }


    return $price;
    }

    ---
    Need to have 8 numbers maximum after 0. so example will be like 0.00000001 or 0.0001

    After the change as per above, when I'm setting price as 0.0001 for example, I'm getting a result: 00001 so there are no decimal point in between and price is showed as 1.
    Could anyone help with this one, please? Thanks!

  2. #2
    Moderator ovidiubica's Avatar
    Join Date
    Mar 2011
    Posts
    5,749
    Thanks
    240
    Thanked 1,061 Times in 999 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  3. #3
    Thread Starter
    iridin's Avatar
    Join Date
    Aug 2009
    Location
    Malta
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You must be an AppThemes customer and logged in to view this response. Join today!

  4. #4
    Thread Starter
    iridin's Avatar
    Join Date
    Aug 2009
    Location
    Malta
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 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. [SOLVED] I need to remove zeros after the decimal
    By ontaskerr in forum Help Using HireBee
    Replies: 5
    Last Post: March 24th, 2018, 11:17 AM
  2. About currency decimal point
    By hryksbt in forum Help Using HireBee
    Replies: 1
    Last Post: December 19th, 2015, 07:02 AM
  3. [SOLVED] I need to remove zeros after the decimal
    By ferencfrigyes in forum Help Using Vantage (Legacy)
    Replies: 2
    Last Post: August 17th, 2014, 11:21 AM
  4. removing zeros after decimal
    By manishkhullar in forum ClassiPress General Discussion
    Replies: 6
    Last Post: March 9th, 2014, 06:40 AM
  5. how can i remove decimal on currency?
    By pulla in forum JobRoller General Discussion
    Replies: 2
    Last Post: December 23rd, 2012, 01:31 AM