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.
我想在我的 jquery 函数中使用浮点值设置字段的值,但它似乎不起作用。我应该在将值分配给我的字段之前将浮点数转换为字符串吗?
var p = ((qI/qO) * 100).toFixed(2); //set the percentage $j("#jqP100i").val(p);
注意:该字段的 id 为 jqP100i,p 为 66.67