[HepData-svn] r1425 - trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Jan 10 11:04:08 GMT 2011


Author: whalley
Date: Mon Jan 10 11:04:07 2011
New Revision: 1425

Log:
better handling of significant figures??

Modified:
   trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java

Modified: trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java
==============================================================================
--- trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java	Thu Dec  9 16:54:22 2010	(r1424)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java	Mon Jan 10 11:04:07 2011	(r1425)
@@ -353,14 +353,14 @@
                             for (PointError e : pt2.getErrors()) {
                                 if (e.getNormType() != ErrorNorm.PCT) {
                                     SignificantFigures vale1 = new SignificantFigures(e.getPlus());
-                                    lsd = Math.min(lsd, vale1.getLSD());
-                                    if (e.getPlus().toString().endsWith("0") || e.getPlus().toString().indexOf("0E") > 0) {
-//                                        lsd += 1;
+                                    int lsd1 =  vale1.getLSD();
+                                    if(!e.getPlus().toString().endsWith("0") && e.getPlus().toString().indexOf("0E") <= 0){
+                                        lsd = Math.min(lsd, lsd1); 
                                     }
                                     SignificantFigures vale2 = new SignificantFigures(e.getMinus());
-                                    lsd = Math.min(lsd, vale2.getLSD());
-                                    if( e.getMinus().toString().endsWith("0") || e.getMinus().toString().indexOf("0E") > 0 ) {
-//                                        lsd += 1;
+                                    int lsd2 =  vale2.getLSD();
+                                    if(!e.getMinus().toString().endsWith("0") && e.getMinus().toString().indexOf("0E") <= 0){
+                                        lsd = Math.min(lsd, lsd2); 
                                     }
                                 }
                             }
@@ -384,7 +384,6 @@
                                     writer.write(Formats.forms(e.getPlus(), msd, -lsd));
                                     writer.write(e.getNormType().toSymbol());
                                 } else {
-                             System.out.println("not Sysmmetric");
                                     vale = new SignificantFigures(e.getPlus());
                                     if(e.getPlus() > e.getMinus()) { writer.write("+"); }
                                     else                           { writer.write("+"); }


More information about the HepData-svn mailing list