details: https://code.openbravo.com/erp/devel/pi/rev/3e5c7b3e8a8f
changeset: 25741:3e5c7b3e8a8f
user: Asier Lostalé <asier.lostale <at> openbravo.com>
date: Thu Jan 22 11:14:24 2015 +0100
summary: fixed bug 28720: callouts incorrectly set big non integer numbers
When a big non integer number was set by a callout, decimal separator was
removed
resulting in a different number, ie. 10200500.45 resulted in 1020050045.00.
The problem was in the OB.Utilities.Number.ScientificToDecimal JavaScript
function
which wrongly assumed scientific exponent always added zeroes to coefficient,
which
is not true in this case where exponent determines where the decimal
separator is
inserted in the coefficient.
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js
| 15 ++++++---
1 files changed, 10 insertions(+), 5 deletions(-)
diffs (26 lines):
diff -r 3722c475350f -r 3e5c7b3e8a8f
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 Jan 20 09:23:02 2015 -0500
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js
Thu Jan 22 11:14:24 2015 +0100
@@ -456,12 +456,17 @@
numberOfZeros = numberOfZeros - split[1].length;
}
- //Create the string of zeros
- for (i = 0; i < numberOfZeros; i++) {
- zeros = zeros + '0';
+ if (numberOfZeros >= 0) {
+ //Need to concatenate zeros to the coefficient
+ for (i = 0; i < numberOfZeros; i++) {
+ zeros = zeros + '0';
+ }
+ //Create the final number
+ number = coeficient + zeros;
+ } else {
+ // final decimal number is not integer: add dot decimal separator in the
correct position
+ number = coeficient.substr(0, coeficient.length + numberOfZeros) + '.' +
coeficient.substr(coeficient.length + numberOfZeros);
}
- //Create the final number
- number = coeficient + zeros;
}
return number;
------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits