Related with issue 29113: Avoid using isc in OB.Utilities.Number.roundJSNumber
authorAugusto Mauch <augusto.mauch@openbravo.com>
Thu, 05 Mar 2015 10:49:36 +0100
changeset 26127 1c75a6afca4e
parent 26126 e9d73be9949d
child 26128 a410732b5a7f
Related with issue 29113: Avoid using isc in OB.Utilities.Number.roundJSNumber

The OB.Utilities.Number.roundJSNumber function is used in the mobile core module, but smartclient is not available there. OB.Utilities.Number.roundJSNumber should not be used there (see [1]), but in the meantime we are going to avoid using smartclient functions in roundJSNumber.

isc.isA.String has been replaced with (typeof num === 'string')

[1] https://issues.openbravo.com/view.php?id=29139
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js	Thu Mar 05 10:15:41 2015 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js	Thu Mar 05 10:49:36 2015 +0100
@@ -39,7 +39,7 @@
   if (isNaN(num)) {
     return NaN;
   }
-  strNum = (isc.isA.String(num) ? num : String(num));
+  strNum = ((typeof num === 'string') ? num : String(num));
   return parseFloat(new BigDecimal(strNum).setScale(dec, BigDecimal.prototype.ROUND_HALF_UP));
 };