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.
当我划分两个不同的变量时,我得到了这个返回:
1.4007342235591407
但我想要的只是两位小数,如下所示:
1.40
这是我的代码:
document.getElementById('place').innerHTML = meter / seler;
使用<number>.toFixed(2).
<number>.toFixed(2)
document.getElementById('place').innerHTML = (meter / seler).toFixed(2);
我目前正在阅读 Rails 教程的第七章,似乎卡在图 7.22 上。简而言之,我无法通过测试。当我跑步时。. .
bundle exec rspec spec/requests/user_pages_spec.rb