diff --git a/gui/src/app/SamplerOutputView/SamplerOutputView.tsx b/gui/src/app/SamplerOutputView/SamplerOutputView.tsx index 500bc9a..1cf0044 100644 --- a/gui/src/app/SamplerOutputView/SamplerOutputView.tsx +++ b/gui/src/app/SamplerOutputView/SamplerOutputView.tsx @@ -108,7 +108,9 @@ const DrawsView: FunctionComponent = ({ >(300); const formattedDraws = useMemo(() => { if (abbreviatedToNumRows === undefined) return draws; - return draws.map((draw) => draw.slice(0, abbreviatedToNumRows)); + return draws.map((draw) => + formatDraws(draw.slice(0, abbreviatedToNumRows)), + ); }, [draws, abbreviatedToNumRows]); const handleExportToCsv = useCallback(() => { const csvText = prepareCsvText( @@ -173,7 +175,7 @@ const DrawsView: FunctionComponent = ({ {drawChainIds[i]} {drawNumbers[i]} - {draws.map((draw, j) => ( + {draws2.map((draw, j) => ( {draw[i]} ))} @@ -196,6 +198,11 @@ const DrawsView: FunctionComponent = ({ ); }; +const formatDraws = (draws: number[]) => { + if (draws.every((x) => Number.isInteger(x))) return draws; + return draws.map((x) => x.toPrecision(6)); +}; + const prepareCsvText = ( draws: number[][], paramNames: string[], diff --git a/gui/src/draws-table.css b/gui/src/draws-table.css index b04a7de..cf794c1 100644 --- a/gui/src/draws-table.css +++ b/gui/src/draws-table.css @@ -22,6 +22,7 @@ .draws-table th, .draws-table td { padding: 2px 2px; + white-space: nowrap; } .draws-table tbody tr {