details: https://code.openbravo.com/erp/devel/pi/rev/03456ea1fc63 changeset: 26780:03456ea1fc63 user: Naroa Iriarte <naroa.iriarte <at> openbravo.com> date: Tue May 26 17:30:26 2015 +0200 summary: Fixed issue 30014: There are problems with big numbers in scientific notation
The problem was in OB.Utilities.Number.OBMaskedToOBPlain. When the function was executed with a big negative number in scientific notation or a positive number with the "+" sign at the beginning, the obtained decimal value was not correct. This was caused because the length of the variable "number" (which was the number in scientific notation), was used for creating the final number instead of the length of the variable "plainNumber", (which was the number in decimal notation). This generated a problem because, when the spected result was a number longer than the number in scientific notation, it was not correctly obtained. For example: -1.0564E7 returned -10564000. This is correct, but: -1.0564E8 returned -10564000. And this is not correct. diffstat: modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diffs (16 lines): diff -r f65d30c40217 -r 03456ea1fc63 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 Tue May 26 22:37:10 2015 +0000 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js Tue May 26 17:30:26 2015 +0200 @@ -73,10 +73,10 @@ var numberSign = ''; if (plainNumber.substring(0, 1) === '+') { numberSign = ''; - plainNumber = plainNumber.substring(1, number.length); + plainNumber = plainNumber.substring(1, plainNumber.length); } else if (plainNumber.substring(0, 1) === '-') { numberSign = '-'; - plainNumber = plainNumber.substring(1, number.length); + plainNumber = plainNumber.substring(1, plainNumber.length); } // Remove ending decimal '0' ------------------------------------------------------------------------------ _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits