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

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Mon Mar 28 15:26:15 BST 2011


Author: whalley
Date: Mon Mar 28 15:26:15 2011
New Revision: 1448

Log:
to control number of decimal places in focus etc.

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 Mar 28 15:24:33 2011	(r1447)
+++ trunk/hepdata-webapp/src/main/java/cedar/hepdata/webapp/components/DatasetAsHtml.java	Mon Mar 28 15:26:15 2011	(r1448)
@@ -263,9 +263,12 @@
                                         int pos2 =  f.toString().indexOf(".");
                                         lsd = pos2-pos1+1;
                                     }
+                                    if(b.getFocusLength() != null){
+                                        lsd = -b.getFocusLength();
+                                    }  
                                 }
                                 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(lsd == -1 && f_val.endsWith(".0") &&  b.getFocusLength() == null){ f_val = f_val.substring(0,f_val.length()-2); }
 
                                 if (low != null && high != null) {
                                     SignificantFigures vall = new SignificantFigures(low);
@@ -282,6 +285,9 @@
                                         int pos2 =  low.toString().indexOf(".");
                                         lsd = pos2-pos1+1;
                                     }    
+                                    if(b.getLowValueLength() != null){
+                                        lsd = -b.getLowValueLength();
+                                    }  
                                     String f_low = Formats.forms(low,lwidth,msd,-lsd);
 
                                     SignificantFigures valh = new SignificantFigures(high);
@@ -298,6 +304,9 @@
                                         int pos2 =  high.toString().indexOf(".");
                                         lsd = pos2-pos1+1;
                                     }    
+                                    if(b.getHighValueLength() != null){
+                                        lsd = -b.getHighValueLength();
+                                    }  
                                     String f_high = Formats.forms(high,hwidth,msd,-lsd);
 
 


More information about the HepData-svn mailing list