简体   繁体   中英

Input decimal fraction in Html,php ,Javascript

我试图输入一个数字12.11,十进制后我只想输入最大值11。如果我尝试输入12.12,则不应输入。

I would suggest looking this stackoverflow question , where is explained how to get the whole part of the number and the fractional part. Then you can just compare the fractional part to 12 or which ever number you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM