Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

How do I 'round and format' a subexpression in a Write-Host?

$
0
0

Hello,

The following division, $($StateTot/$NationTot), gives me 0.191304347826087.  What do I need to do to get the division to format as 19%, so the Write-Host would read Write-Host "The percentage of State to National is 19%"

$StateTot = 66

$NationTot = 345

write-Host "This is how you force evaluation: $($StateTot/$NationTot)"



Thanks for your help! SdeDot


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>