Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
请我有 123,788.98,我想在存储到 dbase 之前删除小数位,以便只有 123,789。我尝试了 round(123,789.98) 但它只给了我 123。
请问如何在不删除逗号的情况下删除小数位?
用逗号分隔,这是两个数字。123 和 788.98。所以只需 round(788.98) 并将它们都插入一行。
INSERT INTO table(row) VALUES ('123,'.round(788.98).'')
如果您有逗号,则可以从表单输入创建两个变量:
list($one, $two) = explode(",", "S_POST['amount']", 2);