details: https://code.openbravo.com/erp/devel/pi/rev/9d50bf45a6c9
changeset: 21984:9d50bf45a6c9
user: Augusto Mauch <augusto.mauch <at> openbravo.com>
date: Wed Feb 12 18:42:08 2014 +0100
summary: Fixes issue 25710: Big numbers are not properly managed in amount
fields
The problem was that the OB.Utilities.Number.OBMaskedToOBPlain function was
removing the '0's after the decimal dot even if the number was being expressed
in decimal notation. This way, '1.12E10' was being converted to '1.12E1'.
This has been fixed by not removing the lasting '0's if the number is expressed
in decmial notation.
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js
| 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (33 lines):
diff -r 248a450b13a8 -r 9d50bf45a6c9
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
Wed Feb 12 17:27:15 2014 +0000
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js
Wed Feb 12 18:42:08 2014 +0100
@@ -11,7 +11,7 @@
* under the License.
* The Original Code is Openbravo ERP.
* The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2011-2012 Openbravo SLU
+ * All portions are Copyright (C) 2011-2014 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -51,7 +51,8 @@
// * The plain OB number
OB.Utilities.Number.OBMaskedToOBPlain = function (number, decSeparator,
groupSeparator) {
number = number.toString();
- var plainNumber = number;
+ var plainNumber = number,
+ decimalNotation = (number.indexOf('E') !== -1);
// Remove group separators
if (groupSeparator) {
@@ -69,8 +70,8 @@
plainNumber = plainNumber.substring(1, number.length);
}
- // Remove ending decimal '0'
- if (plainNumber.indexOf(decSeparator) !== -1) {
+ // Remove ending decimal '0' if the number is not expressed in decimal
notation
+ if (plainNumber.indexOf(decSeparator) !== -1 && !decimalNotation) {
while (plainNumber.substring(plainNumber.length - 1, plainNumber.length)
=== '0') {
plainNumber = plainNumber.substring(0, plainNumber.length - 1);
}
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience. Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits