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

Do not write trailing zeros for decimal values in clickhouse-client or TSV/CSV format #15794

Closed
UnamedRus opened this issue Oct 9, 2020 · 1 comment · Fixed by #27680
Closed
Assignees
Labels
comp-decimal feature st-accepted The issue is in our backlog, ready to take

Comments

@UnamedRus
Copy link
Contributor

Use case
Pretty print and export decimal values which have high accuracy.

Describe the solution you'd like
Have a setting which would remove trailing zeros from clickhouse-client and TSV/CSV format output of decimal values.

Describe alternatives you've considered

taxi9 :) SELECT trim(TRAILING '0' FROM toString(toDecimal128('1312312231.1',20))) as s;

SELECT replaceRegexpOne(toString(toDecimal128('1312312231.1', 20)), concat('[', regexpQuoteMeta('0'), ']*$'), '') AS s

┌─s────────────┐
│ 1312312231.1 │
└──────────────┘

1 rows in set. Elapsed: 0.002 sec.

@alexey-milovidov alexey-milovidov added the st-accepted The issue is in our backlog, ready to take label Aug 15, 2021
@alexey-milovidov alexey-milovidov self-assigned this Aug 15, 2021
@alexey-milovidov
Copy link
Member

Makes sense. Also I've found inefficient implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-decimal feature st-accepted The issue is in our backlog, ready to take
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants