Ask the guest to fill in an amount and automatically add two digits to the back of the mantissa.

Source: Internet
Author: User
Please ask the guest to fill in an amount, automatically add two digits after the mantissa
Please fill in the amount in the next text box. That program moves itself in the mantissa of the amount adds two decimal places and does not repeat within one day.

------Solution--------------------
Automatically add two decimal places you can use JS to achieve what is the need for you to not repeat in a day?
------Solution--------------------
00-99
Only 100 Numbers ...
If you have more than 100, there will be duplicates.

You can find the biggest one before you add it, and then +1.
------Solution--------------------
Add two decimal places and don't repeat this in a day.
------Solution--------------------
PHP Code
$textbox _amount=$_post[' textbox '];//appears double digit $rand_num=rand (00,99);//Set the day range so that the two digits of the day are not duplicated//more troublesome, The idea is that you can put the values of the previous guests into the database, and now fill in the amount of the database inside the comparison, the same again immediately. Finally get the result $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.