From 746a098e7490b8ad0b4440b13412247f8f65fb47 Mon Sep 17 00:00:00 2001 From: malzer <malzer@sub.uni-goettingen.de> Date: Fri, 4 Mar 2022 13:13:55 +0100 Subject: [PATCH] Fix decimal values display issue --- src/components/tools/colorize/colorize.component.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/tools/colorize/colorize.component.js b/src/components/tools/colorize/colorize.component.js index 6197566..0ea889f 100644 --- a/src/components/tools/colorize/colorize.component.js +++ b/src/components/tools/colorize/colorize.component.js @@ -59,10 +59,10 @@ const ColorizeComponent = ({ selectedLayer, layoutProperties, selectLayer, lay {displayedColorBar.map(mapColors)} - <span className="domain-min smallest-text">{rasterMin.toFixed(2)}</span> + <span className="domain-min smallest-text">{rasterMin.toPrecision(2)}</span> <span - className="domain-med smallest-text">{((rasterMin + rasterMax) * 0.5).toFixed(2)}</span> - <span className="domain-max smallest-text">{rasterMax.toFixed(2)}</span> + className="domain-med smallest-text">{((rasterMin + rasterMax) * 0.5).toPrecision(2)}</span> + <span className="domain-max smallest-text">{rasterMax.toPrecision(2)}</span> </div> } @@ -86,11 +86,11 @@ const ColorizeComponent = ({ selectedLayer, layoutProperties, selectLayer, lay <TableBody> <TableRow> <TableCell className="smaller-text"><strong>Minimum pixel value:</strong></TableCell> - <TableCell className="smaller-text">{rasterMin.toFixed(2)}</TableCell> + <TableCell className="smaller-text">{rasterMin.toPrecision(2)}</TableCell> </TableRow> <TableRow> <TableCell className="smaller-text"><strong>Maximum pixel value:</strong></TableCell> - <TableCell className="smaller-text">{rasterMax.toFixed(2)}</TableCell> + <TableCell className="smaller-text">{rasterMax.toPrecision(2)}</TableCell> </TableRow> <TableRow> <TableCell className="smaller-text"><strong>No Data value:</strong></TableCell> -- GitLab