Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
math Floor
#1
Hi,

In QM, is there a function similar to the "floor" function in the "Math" class of C#?


Macro test
Code:
Copy      Help
cl=
;wmic logicaldisk where DeviceID='D:' get Size /value
RunConsole2 cl _s

_s.get(_s find(_s.trim "=")+1)
d=val(_s 2)
out d/1024/1024/1024

Powershell Code:
Code:
Copy      Help
$partition = Get-CimInstance -ClassName Win32_LogicalDisk -Filter "DeviceID = 'D:'"
$sizeBytes = $partition.Size
$sizeGB = [math]::Floor($sizeBytes / 1GB)
$sizeGB
#2
Code:
Copy      Help
double a=2.7
double b=-2.7
int c=a; out c
int d=b; out d
int e=floor(a); out e
int f=floor(b); out f
#3
Thanks for your help!
This is more elegant than using C# functions. Smile


Forum Jump:


Users browsing this thread: 1 Guest(s)