Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030014Openbravo ERPA. Platformpublic2015-05-26 13:182015-06-01 13:02
NaroaIriarte 
NaroaIriarte 
normalmajoralways
closedfixed 
5
 
3.0PR15Q3 
alostale
Core
No
0030014: The function OB.Utilities.Number.OBMaskedToOBPlain is not working properly with negative big numbers
If the function OBMaskedToOBPlain is executed with a big negative number in scientific notation, or a positive number with a "+" sign at the beginning of the number, the retrieved decimal value is not correct.
For example: -1.0564E7 returns -10564000, which is correct, but -1.0564E8 returns -10564000 too, and that is not correct.
1) Execute the following function in the console:

OB.Utilities.Number.OBMaskedToOBPlain('-1.0564E7', '.', ',')

2) It returns "-10564000" so, it works properly.
3) Execute the following function in the console:

OB.Utilities.Number.OBMaskedToOBPlain('-1.0564E8', '.', ',')

4) It returns "-10564000" so, it is not working properly.
No tags attached.
related to defect 00257103.0PR14Q2 closed AugustoMauch Big numbers are not properly managed in amount fields 
related to defect 00285523.0PR15Q2 closed alostale Purchase Invoice amount gets truncated upon saving, when the amount is big 
related to defect 0028720 closed alostale System is not saving big numbers properly 
related to defect 00291133.0PR15Q2 closed AugustoMauch Openbravo interface is not rounding properly the database data 
related to defect 0029709 closed NaroaIriarte Cannot save a physical inventory line with a negative small number in the Book Quantity field 
related to defect 00261323.0PR14Q3 closed guillermogil wrong visualization value of quantity fields with very small numbers 
Issue History
2015-05-26 13:18NaroaIriarteNew Issue
2015-05-26 13:18NaroaIriarteAssigned To => platform
2015-05-26 13:18NaroaIriarteModules => Core
2015-05-26 13:18NaroaIriarteTriggers an Emergency Pack => No
2015-05-26 13:19NaroaIriarteRelationship addedrelated to 0025710
2015-05-26 13:20NaroaIriarteRelationship addedrelated to 0028552
2015-05-26 13:20NaroaIriarteRelationship addedrelated to 0028720
2015-05-26 13:21NaroaIriarteRelationship addeddepends on 0029113
2015-05-26 13:22NaroaIriarteRelationship addedrelated to 0029709
2015-05-26 13:22NaroaIriarteRelationship addedrelated to 0026132
2015-05-26 15:17NaroaIriarteRelationship replacedrelated to 0029113
2015-05-26 16:28NaroaIriarteDescription Updatedbug_revision_view_page.php?rev_id=8658#r8658
2015-05-27 09:29hgbotCheckin
2015-05-27 09:29hgbotNote Added: 0077786
2015-05-27 09:29hgbotStatusnew => resolved
2015-05-27 09:29hgbotResolutionopen => fixed
2015-05-27 09:29hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/03456ea1fc636f400e0faa229ef942dd9fdc2ab4 [^]
2015-05-27 14:57NaroaIriarteIssue Monitored: alostale
2015-05-27 14:58NaroaIriarteReview Assigned To => alostale
2015-05-27 15:28NaroaIriarteAssigned Toplatform => NaroaIriarte
2015-05-27 15:38hudsonbotCheckin
2015-05-27 15:38hudsonbotNote Added: 0077813
2015-06-01 13:02alostaleNote Added: 0077929
2015-06-01 13:02alostaleStatusresolved => closed
2015-06-01 13:02alostaleFixed in Version => 3.0PR15Q3

Notes
(0077786)
hgbot   
2015-05-27 09:29   
Repository: erp/devel/pi
Changeset: 03456ea1fc636f400e0faa229ef942dd9fdc2ab4
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Tue May 26 17:30:26 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/03456ea1fc636f400e0faa229ef942dd9fdc2ab4 [^]

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.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js
---
(0077813)
hudsonbot   
2015-05-27 15:38   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/9cdfae4d18ae [^]
Maturity status: Test
(0077929)
alostale   
2015-06-01 13:02   
code reviewed

tested issues:
0026132
0029709
0028552
0028720
0025710
0030014