Home  >  Article  >  Backend Development  >  How to remove thousandth place in php

How to remove thousandth place in php

藏色散人
藏色散人Original
2020-08-25 09:05:023141browse

php method to remove thousandths: first open the corresponding PHP code; then modify the content to [$product['price1']=$product['price1'];]; finally execute the PHP file That’s it.

How to remove thousandth place in php

## Recommended: "PHP Video Tutorial"

Specific question:

php function, the price of a product is 1500, and now the website displays 1,500.00. How to remove the thousands separator and display 1500.00 or 1500

The function is as follows ,

$product['price1']=number_format($product['price1'],2);

Solution:

$product['price1']=number_format($product['price1'],2);

This line is modified to

$product['price1']=$product['price1'];

The above is the detailed content of How to remove thousandth place in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn