Playground does not display float/decimal results correctly

Aperta
#4,716 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
rust
Ambito
frontend

Direzione di ricerca

The issue reports incorrect decimal display in the public Playground while generated SQL is correct; no source files or tests are named. Start by locating the Playground’s result-rendering code and related tests, then reproduce the supplied PRQL input. Done means the displayed values retain their decimal points and the regression is covered by a test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

web
What happened?

Using the public Playground (version 0.12.2), the Playground displays incorrect results for the round function. It seems to be missing the decimal points in the output.

The generated SQL is correct, and pasting that SQL into SQLite shows the expected results.

PRQL input
from [ { a=1 } ]
select {
  math.round 1  1.23,
  math.round 1  4.56
}
SQL output
WITH table_0 AS (
  SELECT
    1 AS a
)
SELECT
  ROUND(1.23, 1),
  ROUND(4.56, 1)
FROM
  table_0

-- Generated by PRQL compiler version:0.12.2 (https://prql-lang.org)
Expected SQL output
==== EXPECTED ====

ROUND(1.23, 1)	ROUND(4.56, 1)
1.2	4.6

==== ACTUAL ====

round(1.23, 1)	round(4.56, 1)
12	46         <-- Note the lack of decimal points
MVCE confirmation
  • Minimal example
  • New issue
Anything else?

No response

Lingua principale
Rust
Stelle
10.9k
Fork
261
Merge medio
3g 21h
PR unite (30g)
84

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PRQL/prql

Tutte le issue di PRQL/prql

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.