Playground does not display float/decimal results correctly

Đang mở
#4,716 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
rust
Lĩnh vực
frontend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Rust
Star
10.9k
Fork
261
Merge trung bình
3 ngày 21 giờ
Pull request đã merge (30 ngày)
84

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của PRQL/prql

Tất cả issue của PRQL/prql

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.