[Libreoffice-commits] core.git: nlpsolver/src

Laurent Balland-Poirier laurent.balland-poirier at laposte.net
Mon Dec 12 12:27:11 UTC 2016


 nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0412d863d144344b4c6c04b22209c0c57f1d6fb8
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date:   Wed Nov 30 21:50:06 2016 +0100

    tdf#104268 NLPSolver: Improve display of solution
    
    Format "%.2f" is not optimal for large or small values.
    Format "%g" should be prefered.
    
    Change-Id: I92899d80564b9000b1f3e049221c456f8e1176a9
    Reviewed-on: https://gerrit.libreoffice.org/31445
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java
index da8dbb2..e3695a0 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/EvolutionarySolverStatusUno.java
@@ -177,7 +177,7 @@ public class EvolutionarySolverStatusUno extends BaseDialog
     }
 
     public void setBestSolution(double solution, boolean feasible) {
-        lblSolutionValue.setLabel(String.format("%.2f", solution));
+        lblSolutionValue.setLabel(String.format("%g", solution));
         if (feasible)
             lblSolutionValue.setTextColor(defaultTextColor);
         else


More information about the Libreoffice-commits mailing list