Guest User

Untitled

a guest
Jan 12th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. if ( is_numeric( $price ) ) {
  2. $decimals = ( $cp_options->hide_decimals || $price == 0 ) ? 0 : 5;
  3. $decimal_separator = $cp_options->decimal_separator;
  4. $thousands_separator = $cp_options->thousands_separator;
  5.  
  6. $price = number_format( $price, $decimals, $decimal_separator, $thousands_separator );
  7. }
  8.  
  9. return $price;
  10.  
  11. if ( is_numeric( $price ) ) {
  12. $decimals = ( $cp_options->hide_decimals || $price == 0 ) ? 0 : 5;
  13. $decimal_separator = $cp_options->decimal_separator;
  14. $thousands_separator = $cp_options->thousands_separator;
  15.  
  16. $price = number_format( $price, $decimals, $decimal_separator, $thousands_separator );
  17. }
  18.  
  19. if ($decimals ==0){ return floatval($price);}
  20. else {return $price;}
Add Comment
Please, Sign In to add comment