differencePercentage = Math.round(((Pay.init/Pay.current)* 100) - 100);百分比值的極化移位
並且這給了我在初始和當前薪酬之間的百分比差異,但它是相反的。當它是正值時,即薪酬高於初始值時表示-X%,當它低於時表示X%。
有沒有什麼明顯的方法,我沒有看到這極化?
感謝您的任何見解。 :)
differencePercentage = Math.round(((Pay.init/Pay.current)* 100) - 100);百分比值的極化移位
並且這給了我在初始和當前薪酬之間的百分比差異,但它是相反的。當它是正值時,即薪酬高於初始值時表示-X%,當它低於時表示X%。
有沒有什麼明顯的方法,我沒有看到這極化?
感謝您的任何見解。 :)
differencePercentage = Math.round(100 - ((Pay.init/Pay.current) * 100));
[ - (一 - B)= -a + B = - A]
另外:
differencePercentage = Math.round(100 * (1 - (Pay.init/Pay.current)));
differencePercentage = Math.round(((Pay.current/Pay.init)* 100) - 100);
非常感謝你們雙方。我會起牀代表我所以我可以++你嘿。 – aethys 2010-01-01 05:52:13