Kaydet (Commit) 0412d863 authored tarafından Laurent Balland-Poirier's avatar Laurent Balland-Poirier Kaydeden (comit) Noel Grandin

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/31445Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst d5d6ee3b
...@@ -177,7 +177,7 @@ public class EvolutionarySolverStatusUno extends BaseDialog ...@@ -177,7 +177,7 @@ public class EvolutionarySolverStatusUno extends BaseDialog
} }
public void setBestSolution(double solution, boolean feasible) { public void setBestSolution(double solution, boolean feasible) {
lblSolutionValue.setLabel(String.format("%.2f", solution)); lblSolutionValue.setLabel(String.format("%g", solution));
if (feasible) if (feasible)
lblSolutionValue.setTextColor(defaultTextColor); lblSolutionValue.setTextColor(defaultTextColor);
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment