先写下自己的用法:parseFloat((Number(num)*100).toFixed(n)/100); 原文https://www.hangge.com/blog/cache/detail_1791.html