Input retains two decimal places, exceeding the hidden

value = value.replace (/ ^ (-) (d +). (dd). $/,"$1decimal 2.decimal 3"); / / you can only enter two decimals
so you can"t enter a negative value. What"s going on?

Mar.07,2021

value = value.replace(/^(-)?(\d+)\.(\d\d).*$/,'$1$2.$3');

try this as above


you can use toFixed, but you need to convert it to Number type


Number . There is no replace method. You only support String type: value.toString (). Replace (/ ^ (-)? (\ d +)\ (\ d\ d) (. *) $/,'$1room2.03') .

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e455b7-44b2b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e455b7-44b2b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?