Fix Windows check_memory rounding

This fixes a rounding problem within the Windows check_memory plugin.

refs #6161
This commit is contained in:
Michael Insel 2018-04-18 21:24:16 +02:00
parent fa615ec291
commit 8cbb7494d2
1 changed files with 2 additions and 2 deletions

View File

@ -203,8 +203,8 @@ static int check_memory(printInfoStruct& printInfo)
memBuf.dwLength = sizeof(memBuf);
GlobalMemoryStatusEx(&memBuf);
printInfo.tRam = round(memBuf.ullTotalPhys / pow(1024.0, printInfo.unit));
printInfo.aRam = round(memBuf.ullAvailPhys / pow(1024.0, printInfo.unit));
printInfo.tRam = round((memBuf.ullTotalPhys / pow(1024.0, printInfo.unit) * pow(10.0, printInfo.unit))) / pow(10.0, printInfo.unit);
printInfo.aRam = round((memBuf.ullAvailPhys / pow(1024.0, printInfo.unit) * pow(10.0, printInfo.unit))) / pow(10.0, printInfo.unit);
printInfo.percentFree = 100.0 * memBuf.ullAvailPhys / memBuf.ullTotalPhys;
if (l_Debug)