usually with Number_format (); To format numbers, the default thousand are separated by commas, such as:
Copy Code code as follows:
Echo Number_format ("10000.01231", 2);
2 digits after the decimal point, the output result is: 10,000.1000 digits are separated by commas.
It would be a bit of a hassle if we were backstage verifying the numbers in this format that were obtained from the client.
Old practitioners commonly used filter_input (Input_post, "price", filter_validate_float) to verify prices, if it is a comma with the thousand character will not be obtained.
So when you confirm that the input is a number, you first filter out all the thousand characters and then verify.
In fact, very few people will enter numbers with the thousand characters, unless they are copied or the original output value is resubmitted.
In the output we can use as little as possible with the number of thousand characters format, the output can be written:
Copy Code code as follows:
Format_number ("10000.01231", 2, ".", "");
That's 10000.01 of the output.