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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Jan 13 09:50:46 GMT 2011


Author: whalley
Date: Thu Jan 13 09:50:45 2011
New Revision: 1426

Log:
allow upside down +- sign

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	Mon Jan 10 11:04:07 2011	(r1425)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java	Thu Jan 13 09:50:45 2011	(r1426)
@@ -351,15 +351,19 @@
 
                         if (pt2.getRelation() == Relation.EQUALS) {
                             for (PointError e : pt2.getErrors()) {
+                                int lsd1 = 0;
+                                int lsd2 = 0;
                                 if (e.getNormType() != ErrorNorm.PCT) {
                                     SignificantFigures vale1 = new SignificantFigures(e.getPlus());
-                                    int lsd1 =  vale1.getLSD();
+                                    lsd1 =  vale1.getLSD();
                                     if(!e.getPlus().toString().endsWith("0") && e.getPlus().toString().indexOf("0E") <= 0){
-                                        lsd = Math.min(lsd, lsd1); 
+//                                    if(e.getPlus().toString().indexOf("0E") <= 0){
+                                       lsd = Math.min(lsd, lsd1); 
                                     }
                                     SignificantFigures vale2 = new SignificantFigures(e.getMinus());
-                                    int lsd2 =  vale2.getLSD();
+                                    lsd2 =  vale2.getLSD();
                                     if(!e.getMinus().toString().endsWith("0") && e.getMinus().toString().indexOf("0E") <= 0){
+//                                    if(e.getMinus().toString().indexOf("0E") <= 0){
                                         lsd = Math.min(lsd, lsd2); 
                                     }
                                 }
@@ -383,6 +387,16 @@
                                     if (msd <= 0) msd = 1;
                                     writer.write(Formats.forms(e.getPlus(), msd, -lsd));
                                     writer.write(e.getNormType().toSymbol());
+                                } else if (e.isSymmetricReversed()) {
+                                    vale = new SignificantFigures(e.getPlus());
+                                    writer.writeRaw(" ∓ "); // chosen to allow breaks *before* the +- sign only
+                                    if (e.getNormType() == ErrorNorm.PCT) {
+                                        lsd = vale.getLSD();
+                                    }
+                                    msd = vale.getMSD();
+                                    if (msd <= 0) msd = 1;
+                                    writer.write(Formats.forms(e.getMinus(), msd, -lsd));
+                                    writer.write(e.getNormType().toSymbol());
                                 } else {
                                     vale = new SignificantFigures(e.getPlus());
                                     if(e.getPlus() > e.getMinus()) { writer.write("+"); }


More information about the HepData-svn mailing list