Home > Backend Development > PHP Problem > How to remove thousandth place in php

How to remove thousandth place in php

藏色散人
Release: 2023-03-05 07:34:02
Original
3181 people have browsed it

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);
Copy after login
Copy after login

Solution:

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

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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template