javier_rar
New Member
all,I'm making a shopping cart that only accept input number with 1 decimal place.The following is piece of code I get from a library (with some modification):\[code\]$items['qty'] = trim(preg_replace('/([^0-9\.])/i', '', $items['qty']));\[/code\]This will accept any number. but I want to make it as only 1 decimal. how to modify the code?Thanks