VMware Cloud Community
gerf0727
Enthusiast
Enthusiast
Jump to solution

How to leave only two decimals in UsedSpaceGB value

Hello,

I have the following instruction:

get-vm server* | select name,UsedSpaceGB,VMhost,guest | ft -auto

but the usedspace gb is like this 104.06407394539564847946166992

How can i set it to 104.06 ?

Tags (1)
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

With the Round fucntion

get-vm server* | 
select name,@{N="UsedSpaceGB";E={[math]::Round($_.UsedSpaceGB,2)}},VMhost,guest | ft -auto


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

1 Reply
LucD
Leadership
Leadership
Jump to solution

With the Round fucntion

get-vm server* | 
select name,@{N="UsedSpaceGB";E={[math]::Round($_.UsedSpaceGB,2)}},VMhost,guest | ft -auto


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference