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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Feb 7 11:15:54 GMT 2011


Author: whalley
Date: Mon Feb  7 11:15:54 2011
New Revision: 1437

Log:
tweaks for intger x values

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 31 11:48:03 2011	(r1436)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java	Mon Feb  7 11:15:54 2011	(r1437)
@@ -265,6 +265,7 @@
                                     }
                                 }
                                 String f_val = Formats.forms(f,fwidth, msd,-lsd);
+                                if(lsd == -1 && f_val.endsWith(".0") ){ f_val = f_val.substring(0,f_val.length()-2); }
 
                                 if (low != null && high != null) {
                                     SignificantFigures vall = new SignificantFigures(low);
@@ -404,7 +405,8 @@
                                     writer.write(e.getNormType().toSymbol());
                                 } else {
                                     vale = new SignificantFigures(e.getPlus());
-                                    if(e.getPlus() > e.getMinus()) { writer.write("+"); }
+                                    if(e.getPlus()<0.0){ writer.write("");}
+                                    else if(e.getPlus() > e.getMinus()) { writer.write("+"); }
                                     else                           { writer.write("+"); }
                                     if (e.getNormType() == ErrorNorm.PCT) { lsd = vale.getLSD(); }
                                     msd = vale.getMSD();
@@ -412,7 +414,8 @@
                                     writer.write(Formats.forms(e.getPlus(), msd, -lsd));
                                     writer.write(e.getNormType().toSymbol());
                                     vale = new SignificantFigures(e.getMinus());
-                                    if(e.getPlus() > e.getMinus()) { writer.writeRaw(",-");}
+                                    if(e.getPlus()<0.0){ writer.writeRaw(",+");}
+                                    else if(e.getPlus() > e.getMinus()) { writer.writeRaw(",-");}
 //                                    else                           { writer.write(",+"); }
                                     else                           { writer.write(",-"); }
                                     if (e.getNormType() == ErrorNorm.PCT) { lsd = vale.getLSD(); }


More information about the HepData-svn mailing list