Title: Decimal price
Last modified: October 1, 2016

---

# Decimal price

 *  Resolved [souma23](https://wordpress.org/support/users/souma23/)
 * (@souma23)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/decimal-price/)
 * Hello,
    would you please help me remove decimal price from mywebsite here after
   the code used by theme creator:
 * */
    function classifieds_pricing_format( $price ){ $price = number_format( $price,
   2 ); $unit_position = classifieds_get_option( ‘unit_position’ ); $unit = classifieds_get_option(‘
   unit’ ); $price_el = explode(‘.’, $price); $main_price = $price_el[0]; $decimal_price
   = $price_el[1]; if( $unit_position == ‘back’ ){ $price_html = $main_price.'<span
   >.’.$decimal_price.'</span><span>’.$unit.'</span>’; } else{ $price_html = ‘<span
   >’.$unit.'</span>’.$main_price.'<span>.’.$decimal_price.'</span>’; }
 *  return $price_html;
    }
 * /*
 * PS: I tried to replace 2 by 0 in number format; I got it removed but the decimal
   separator ( the point separating main price from decimal price) is still there!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Mark Ratledge](https://wordpress.org/support/users/songdogtech/)
 * (@songdogtech)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/decimal-price/#post-8242395)
 * See the . in `<span>.’.$decimal_price.'` right after the `<span>` tag?
 *  Thread Starter [souma23](https://wordpress.org/support/users/souma23/)
 * (@souma23)
 * [9 years, 8 months ago](https://wordpress.org/support/topic/decimal-price/#post-8242471)
 * that right,problem was in the point
 * now it is perfect
 * thanks a lot Mark

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Decimal price’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [souma23](https://wordpress.org/support/users/souma23/)
 * Last activity: [9 years, 8 months ago](https://wordpress.org/support/topic/decimal-price/#post-8242471)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
