Power Management Customized Fixlet

I have a relevance for IEM Power Management, This fixlet result was shown floating value like (o.4444444)

please find the below relevance:

q:((if (it starts with “.”) then (“0”&it) else (it)) of (it as string)) of ( if (not exists (it as floating point)) then error “ERROR:ResultNotFloatingPoint” else if (nan of it) then error “ERROR:ResultNotANumber” else if (it < 0) then error “ERROR:ResultNegativeNumber” else if (it = 0) then ((“0.000000” as floating point)) else it ) of (if (((((name of operating system starts with “Win”) AND (version of client >= “8”)) OR ((name of operating system = “Mac OS X”) AND (version of client >= “8.1”))) AND ((exists setting “_BESClient_PowerHistory_EnablePowerHistory” whose (exists value whose (it = “1”) of it) of client)))) then ( (sum of (length of ranges of item 1 of it / second) of (item 0 of it, system intervals of item 1 of it) whose (item 0 of it = state of item 1 of it) of ((standby state), it) / sum of ((((length of it) / second) of (ranges of it) of (system intervals of it) whose (state of it != invalid state) ) of (it)) as floating point * (day / hour)) of (power history) ) else ( if (if (name of operating system starts with “Win”) then (exists (folder “Power Management” of parent folder of regapp “besclient.exe”) AND exists (file “SystemHistory.dat” of (folder “Power Management” of parent folder of regapp “besclient.exe”)) AND exists (file “MonitorHistory.dat” of (folder “Power Management” of parent folder of regapp “besclient.exe”)) AND ( ((exists file (pathname of parent folder of regapp “besclient.exe” & “\Power Management\BESPower.exe”)) AND (exists file (pathname of parent folder of regapp “besclient.exe” & “\BESClientLoggingService\lib\StandbyPowerTracker.dll”)) AND (exists running service “BESClientLoggingService”) AND (exists key “HKEY_LOCAL_MACHINE\SOFTWARE\BigFix\LoggingService\Plugins\Locations” whose (exists value “BF_PM” whose (it = (pathname of parent folder of regapp “besclient.exe” & “\BESClientLoggingService\lib\StandbyPowerTracker.dll”) of it) of it) of registry))) ) else (false)) then ((((sum of (if parenthesized part 2 of it != " " then (((parenthesized part 2 of it ) as time- (parenthesized part 1 of it) as time )/ second ) else (((now) - (parenthesized part 1 of it) as time)/ second )) of (matches (regular expression “^([^;]);([^;]);([^;]);([^;])%24”) of it) whose(parenthesized part 4 of it = “standby”) of lines of it)) / (sum of (if (following text of last “;” of it = “invalid”) then 0 else (if (preceding text of firsts “;” of following text of first “;” of it) != " " then (((preceding text of firsts “;” of following text of first “;” of it as time) - (preceding text of firsts “;” of it as time)) / second) else (now - preceding text of firsts “;” of it as time) / second)) of lines of (it)) as floating point ) of (file “SystemHistory.dat” of (folder “Power Management” of parent folder of regapp “besclient.exe”)) * ((day / hour))) else ( (if ((if (name of operating system = “Mac OS X”) then ((if (it = “Never”) then it else preceding text of last “:” of ((it as integer*minute) as string)) of (if exists file “/Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist” then ((if it = 3 then “Never” else (if it = 2 then “10” else (if it = 1 then “10” else ((if (it = 0) then “Never” else it as string) of integer “System Sleep Timer” of dictionary “AC Power” of dictionary “Custom Profile” of dictionary of file “/Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist”)))) of integer “AC Power” of dictionary “ActivePowerProfiles” of dictionary of it) of file “/Library/Preferences/SystemConfiguration/com.apple.PowerManagement.plist” else “10”)) else ( if (major version of operating system = 6) then (if (exists key (“HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings” & “29f6c1db-86da-48c5-9fdb-f2b67b1f44da”) whose (exists value “ACSettingIndex” of it) of registry) then ( (if (it as time interval = 0 * second) then “Never” else (preceding text of last “:” of it)) of (((it as integer) * second) as string) of (value “ACSettingIndex” of key (“HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings” & “29f6c1db-86da-48c5-9fdb-f2b67b1f44da”) of registry)) else ((if (exist key (“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes” & (value “ActivePowerScheme” of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes” of registry as string) & “\238c9fa8-0aad-41ed-83f4-97be242c8f20\29f6c1db-86da-48c5-9fdb-f2b67b1f44da”) whose (value “ACSettingIndex” of it != “”) of registry) then ((if (it as time interval = 0 * second) then “Never” else (preceding text of last “:” of it)) of (((value “ACSettingIndex” of key (“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes” & (value “ActivePowerScheme” of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes” of registry as string) & “\238c9fa8-0aad-41ed-83f4-97be242c8f20\29f6c1db-86da-48c5-9fdb-f2b67b1f44da”) of registry as integer) * second) as string)) else if (exists key (“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238c9fa8-0aad-41ed-83f4-97be242c8f20\29f6c1db-86da-48c5-9fdb-f2b67b1f44da\DefaultPowerSchemeValues” & (value “ActivePowerScheme” of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes” of registry as string)) whose (value “ACSettingIndex” of it != “”) of registry) then ((if (it as time interval = 0 * second) then “Never” else (preceding text of last “:” of it)) of (((value “ACSettingIndex” of key (“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238c9fa8-0aad-41ed-83f4-97be242c8f20\29f6c1db-86da-48c5-9fdb-f2b67b1f44da\DefaultPowerSchemeValues” & (value “ActivePowerScheme” of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes” of registry as string)) of registry as integer) * second) as string)) else “Disabled”))) else ((((if (item 4 of it = “02” OR item 5 of it = “00”) then ((if (it = 0) then “Never” else preceding text of last “:” of ((it * second) as string)) of (hexadecimal integer (item 0 of it & item 1 of it))) else (“Never”))) of ((last 2 of first 124 of (value “AcPolicy” of it as string)) , (last 2 of first 122 of (value “AcPolicy” of it as string)) , (last 2 of first 180 of (value “AcPolicy” of it as string)) , (last 2 of first 178 of (value “AcPolicy” of it as string)) , (last 2 of first 98 of (value “AcPolicy” of it as string)) , (if (exists value “Heuristics” of it) then (last 2 of first 14 of (value “Heuristics” of it as string)) else (“00”))) of (key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Power” of registry))) )) != “Never”) then ( (if (item 0 of it < item 1 of it) then (item 1 of it) else item 0 of it) of ((((((day / hour)) * (if (it < “1.1” as floating point AND it > 1) then “1.000000” as floating point else (if (it > “1.1” as floating point) then error “ERROR:AppUsagePercentageThresholdExceeded” else if (it < 0) then error “ERROR:AppUsagePercentageNegative” else it)) of (( (if (it < 0) then (error “ERROR:AppUsageNegativeDuration”) else it) of (((total duration of it) / second) as floating point) / ((if (it < 0) then (error “ERROR:AppUsageNegativeTrackedTime”) else (it)) of ( ((((last time seen of it) - (if exists setting “_BESClient_UsageManager_PowerTrackingStartDate” whose (exists value of it) of client then (value of setting “_BESClient_UsageManager_PowerTrackingStartDate” of client) as time else first start time of it)) / second) as floating point) of (if (name of operating system starts with “Win”) then (application usage summary “BESClient.exe”) else (application usage summary “BESAgent”)) + (10 * minute / second) )) ) of (if name of operating system = “Mac OS X” then application usage summary “BESAgent” else application usage summary “besclient.exe”)))) - ((( (if(-significance place of it < 5) then more significance ( 5 - (-significance place of it) as integer ) of it else less significance ((-significance place of it) as integer - 5) of it) of (value of setting “PowerManagement_AvgWorkday” of client as string as floating point) )))), ((“0.000000” as floating point)))) else ((“0.000000” as floating point)) ) ) ))
A: 0.37011965958938
T: 27.842 ms

But I want this value round of like “0.37” because of time format is 02:35 like this, so any one customized this fixlet for round off value.

Thanks,
Nagaraj.

Here is a snippet of code I used for 2 digit percentage that may be of some use.

(if length of it > 2 then (first 2 of it & “.” & following text of first 2 of it) else it) of (following text of first “.” of ((relative significance place 4 of (191254 as floating point / 194942 as floating point)) as string))

Add this as a prefix to the relevance, wrapping the original code with (), if necessary:

(it/100) of (it * 100 as integer as floating point) of ...

You may obtain the result by adding
(relative significance place 2 of (it as floating point)) of
in front of the property.

For instance the property “Computer Power Usage in kWh / Day” begins with:
((if (it starts with “.”) …

If you define a property as
(relative significance place 2 of (it as floating point)) of ((if (it starts with “.”) …
the resulting number is rounded to the second significant digit .
The full reference manual you may find ar URL
"http://support.bigfix.com/inspectors/Primitive%20Objects_Any.html#floating point"