Ask the customer to fill in the amount and automatically add two digits after the ending number

Source: Internet
Author: User
If you fill in the amount, add two digits to the end of the number. in the next text box, enter the amount. the program automatically adds two decimal places to the end of the amount and does not repeat them within one day ., automatically adding two decimal places can be implemented using js. What is your need to not repeat each day ?, One hundred-99 is only... If your quantity exceeds the limit, please fill in the amount and add two digits to the end of the number.
Enter the amount in the next text box. then the program automatically adds two decimal places to the end of the amount without repeating them within one day.

------ Solution --------------------
Automatically adding two decimal places can be implemented using js. What is your need to not repeat each day?
------ Solution --------------------
00-99
Only one hundred numbers...
If your number exceeds 100, there will be duplicates.

You can find the largest one before adding, and then + 1
------ Solution --------------------
Add two decimal places and do not repeat them in a day.
------ Solution --------------------
PHP code
$ Textbox_amount = $ _ POST ['textbox ']; // two digits are displayed immediately. $ rand_num = rand (); // you can specify the daily range, it is troublesome to keep the double-digit numbers in one day. the general idea is to store the values entered by the previous customers in the database, and then compare the amount entered with the database, same, and then again. // The final result is $ textbox_amount = $ textbox_amount. ".". $ rand_num;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.