From bca69c741a2ddc52a41cd9898d5a7df470d02f62 Mon Sep 17 00:00:00 2001 From: hilpitome Date: Mon, 18 Dec 2023 10:47:19 +0300 Subject: [PATCH 1/2] fix numberformat exception --- .../com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java | 4 ++-- gradle.properties | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java index 619e85e09..db2d697ca 100644 --- a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java +++ b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java @@ -355,8 +355,8 @@ private void appendHealthData(JSONObject returnObject, WidgetArgs widgetArgs) { JSONObject currentHeight = getSingleStepJsonObject(widgetArgs, STEP1, OptibpConstants.HEIGHT); JSONObject currentWeight = getSingleStepJsonObject(widgetArgs, STEP1, OptibpConstants.CURRENTWEIGHT); if (currentHeight != null && currentWeight != null) { - returnObject.put(OptibpConstants.HEIGHT, Integer.parseInt(currentHeight.optString(VALUE))); - returnObject.put(OptibpConstants.WEIGHT, Integer.parseInt(currentWeight.optString(VALUE))); + returnObject.put(OptibpConstants.HEIGHT, Double.valueOf(currentHeight.optString(VALUE))); + returnObject.put(OptibpConstants.WEIGHT, Double.valueOf(currentWeight.optString(VALUE))); } } catch (JSONException e) { Timber.e(e); diff --git a/gradle.properties b/gradle.properties index be834e97e..e916c930f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=3.1.2-SNAPSHOT +VERSION_NAME=3.1.3-DEV-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Native Form Json Wizard From bac0f0e6ff2be24467cad0624fabc557b5438994 Mon Sep 17 00:00:00 2001 From: hilpitome Date: Mon, 18 Dec 2023 17:06:56 +0300 Subject: [PATCH 2/2] truncate height and weight decimal digits --- .../com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java | 4 ++-- gradle.properties | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java index db2d697ca..e19e9dd40 100644 --- a/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java +++ b/android-json-form-wizard/src/main/java/com/vijay/jsonwizard/widgets/OptiBPWidgetFactory.java @@ -355,8 +355,8 @@ private void appendHealthData(JSONObject returnObject, WidgetArgs widgetArgs) { JSONObject currentHeight = getSingleStepJsonObject(widgetArgs, STEP1, OptibpConstants.HEIGHT); JSONObject currentWeight = getSingleStepJsonObject(widgetArgs, STEP1, OptibpConstants.CURRENTWEIGHT); if (currentHeight != null && currentWeight != null) { - returnObject.put(OptibpConstants.HEIGHT, Double.valueOf(currentHeight.optString(VALUE))); - returnObject.put(OptibpConstants.WEIGHT, Double.valueOf(currentWeight.optString(VALUE))); + returnObject.put(OptibpConstants.HEIGHT, (int) Double.parseDouble(currentHeight.optString(VALUE))); + returnObject.put(OptibpConstants.WEIGHT, (int) Double.parseDouble(currentWeight.optString(VALUE))); } } catch (JSONException e) { Timber.e(e); diff --git a/gradle.properties b/gradle.properties index e916c930f..40958f5b4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -VERSION_NAME=3.1.3-DEV-SNAPSHOT +VERSION_NAME=3.1.4-DEV-SNAPSHOT VERSION_CODE=1 GROUP=org.smartregister POM_SETTING_DESCRIPTION=OpenSRP Client Native Form Json Wizard