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!