Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculate result based on percentage in Powershell

Tags:

powershell

I want to calculate the following in Powershell

$x = 100
$y = 25
result = x * y%

Should be really simple, but I can't seem to come up with the right way to calculate the correct result in Powershell

like image 992
Mister Iks Avatar asked Oct 18 '25 17:10

Mister Iks


1 Answers

Divide by 100 to get the percentage:

$x = 100
$y = 25
$result = $x * ($y / 100)
like image 137
Mark Wragg Avatar answered Oct 20 '25 06:10

Mark Wragg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!