Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decimals not formatted correctly in ouput (decimal places missing) #13985

Closed
2 tasks done
Julian-J-S opened this issue Jan 25, 2024 · 0 comments · Fixed by #15457
Closed
2 tasks done

Decimals not formatted correctly in ouput (decimal places missing) #13985

Julian-J-S opened this issue Jan 25, 2024 · 0 comments · Fixed by #15457
Labels
A-dtype-decimal Area: decimal data type bug Something isn't working P-low Priority: low python Related to Python Polars

Comments

@Julian-J-S
Copy link
Contributor

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

pl.DataFrame(
    {
        "x": [1, 1.2, 1.23],
    }
).with_columns(
    d=pl.col("x").cast(pl.Decimal(scale=2)),
)

Log output

shape: (3, 2)
┌──────┬───────────────┐
│ x    ┆ d             │
│ ---  ┆ ---           │
│ f64  ┆ decimal[38,2] │
╞══════╪═══════════════╡
│ 1.0  ┆ 1             │ >>>>>> no decimal places shown?!
│ 1.2  ┆ 1.20          │
│ 1.23 ┆ 1.23          │
└──────┴───────────────┘

Issue description

decimals that have no "fraction" are displayed without the specified "scale"/digits

Expected behavior

All values should be formatted with the given "scale"! (this is also the case in spark/pyspark)

Installed versions

0.20.5
@Julian-J-S Julian-J-S added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Jan 25, 2024
@deanm0000 deanm0000 added A-dtype-decimal Area: decimal data type P-low Priority: low and removed needs triage Awaiting prioritization by a maintainer labels Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dtype-decimal Area: decimal data type bug Something isn't working P-low Priority: low python Related to Python Polars
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants