Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0028561
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] A. Platformminorhave not tried2015-01-12 11:062015-11-23 21:17
ReporterAugustoMauchView Statuspublic 
Assigned Tocaristu 
PrioritynormalResolutionfixedFixed in Version3.0PR16Q1
StatusclosedFix in branchFixed in SCM revisionc6c9ab6f8cae
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toalostale
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0028561: OB.Utilities.Number.ScientificToDecimal does not work properly with numbers with leading zeros

DescriptionGiven a number, the returned value of the OB.Utilities.Number.ScientificToDecimal varies if the number has leading zeros.

For instance:

OB.Utilities.Number.ScientificToDecimal('3.4e-2', '.') => "0.034" (OK)
OB.Utilities.Number.ScientificToDecimal('3.4e-02', '.') => "0.034" (OK)
OB.Utilities.Number.ScientificToDecimal('03.4e-2', '.') => "0.0034" (Wrong, a different number is returned)

OB.Utilities.Number.ScientificToDecimal('3.4e2', '.') => "340" (OK)
OB.Utilities.Number.ScientificToDecimal('3.4e02', '.') => "340" (OK)
OB.Utilities.Number.ScientificToDecimal('03.4e2', '.') => "0340" (A leading zero is added, it is not as wrong as with a negative exponent, but should also be fixed)



Steps To Reproduce- Login in Openbravo
- Open the developers console.
- Enter this expressions and check that if the input number has leading zeroes the result varies.

OB.Utilities.Number.ScientificToDecimal('3.4e-2', '.');
OB.Utilities.Number.ScientificToDecimal('03.4e-2', '.');
OB.Utilities.Number.ScientificToDecimal('3.4e2', '.');
OB.Utilities.Number.ScientificToDecimal('03.4e2', '.');
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00285523.0PR15Q2 closedalostale Purchase Invoice amount gets truncated upon saving, when the amount is big 
related to defect 00261323.0PR14Q3 closedguillermogil wrong visualization value of quantity fields with very small numbers 

-  Notes
(0081912)
hgbot (developer)
2015-11-17 09:05

Repository: erp/devel/pi
Changeset: c6c9ab6f8caed480e671a6724dd6145ab8149c8c
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Tue Nov 17 09:04:02 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/c6c9ab6f8caed480e671a6724dd6145ab8149c8c [^]

fixes issue 28561: OB.Utilities.Number.ScientificToDecimal and leading zeros

OB.Utilities.Number.ScientificToDecimal was not working properly if the number passed as parameter had leading zeros. To fix the problem we use a regular expression to remove them: we look for at least one zero at the beginning of the string representation of the number. If found, it is deleted by replacing it with ''.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/test/ob-utilities-number-test.js
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js
---
(0082056)
alostale (manager)
2015-11-23 08:56

code reviewed

tested

verified new test is executed as part of ci
(0082246)
hudsonbot (developer)
2015-11-23 21:17

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/7b56bebaaa88 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2015-01-12 11:06 AugustoMauch New Issue
2015-01-12 11:06 AugustoMauch Assigned To => AugustoMauch
2015-01-12 11:06 AugustoMauch Modules => Core
2015-01-12 11:06 AugustoMauch Triggers an Emergency Pack => No
2015-01-12 11:07 AugustoMauch Relationship added related to 0028552
2015-01-12 11:07 AugustoMauch Relationship added related to 0026132
2015-03-11 10:08 alostale Priority normal => high
2015-03-11 10:08 alostale Status new => acknowledged
2015-03-17 14:37 alostale Assigned To AugustoMauch => platform
2015-11-11 11:37 alostale Priority high => normal
2015-11-16 10:54 caristu Assigned To platform => caristu
2015-11-16 10:54 caristu Status acknowledged => scheduled
2015-11-17 09:04 caristu Review Assigned To => alostale
2015-11-17 09:04 caristu Issue Monitored: alostale
2015-11-17 09:05 hgbot Checkin
2015-11-17 09:05 hgbot Note Added: 0081912
2015-11-17 09:05 hgbot Status scheduled => resolved
2015-11-17 09:05 hgbot Resolution open => fixed
2015-11-17 09:05 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c6c9ab6f8caed480e671a6724dd6145ab8149c8c [^]
2015-11-23 08:56 alostale Note Added: 0082056
2015-11-23 08:56 alostale Status resolved => closed
2015-11-23 08:56 alostale Fixed in Version => 3.0PR16Q1
2015-11-23 21:17 hudsonbot Checkin
2015-11-23 21:17 hudsonbot Note Added: 0082246


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker