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 中查找整数的百分比:有一个具有不同值的变量基于所选属性获取(例如,该变量的值可能为 0.27)
是否有一个已经创建的函数来找到6.61375661375662%那个值(0.27)?还是我需要手动编写公式?
6.61375661375662%
(0.27)
var percentage = your_var * .0661375661375662;
或(为清楚起见):
var percentage = your_var * 6.61375661375662 / 100;