From 89c4ab3fbdadad0e93dc0eefd10dcf45a680b1f7 Mon Sep 17 00:00:00 2001 From: inoshperera Date: Fri, 19 Jan 2018 10:56:51 +0530 Subject: [PATCH] fixing https://github.com/wso2/product-iots/issues/1605 --- .../device-view.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js index 7e33ea036..6135e0780 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view/device-view.js @@ -163,13 +163,12 @@ function onRequest(context) { } viewModel["externalMemory"] = {}; - viewModel["externalMemory"]["total"] = replaceNaNVal(Math. - round(filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 100) / 100); if (filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] != 0) { + viewModel["externalMemory"]["total"] = replaceNaNVal(Math.round + (filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 100) / 100); viewModel["externalMemory"]["usage"] = replaceNaNVal(Math. - round((filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] - - filteredDeviceData["latestDeviceInfo"]["externalAvailableMemory"]) - / filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] * 10000) / 100); + round((filteredDeviceData["latestDeviceInfo"]["externalTotalMemory"] - + filteredDeviceData["latestDeviceInfo"]["externalAvailableMemory"])* 100) /100); } else { viewModel["externalMemory"]["usage"] = 0; }