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

Format Integers with commas #1877

Closed
mfouilleul opened this issue Jul 13, 2017 · 8 comments
Closed

Format Integers with commas #1877

mfouilleul opened this issue Jul 13, 2017 · 8 comments

Comments

@mfouilleul
Copy link
Contributor

Hello,

Our users complains about the integers are shown with comma.

Example

SELECT id FROM test;

Where id is INT(11) unsigned

Result is 21,668

Do you know if we can fix it quickly?

Thanks

Max.

@dersphere
Copy link

Maybe a little late but I ran into the same issue and solved it by casting the id-column to char.
In your case: SELECT CAST(id as CHAR(8)) as id FROM test;
Hacky "but it works" ;)

@arikfr
Copy link
Member

arikfr commented Feb 5, 2018

V4 includes the ability to configure how each column is rendered, so you can control whether you want the commas in integers or not.

@arikfr arikfr closed this as completed Feb 5, 2018
@chgxtony
Copy link

@arikfr how to configure how each column is rendered

@rohit-conn
Copy link

Currently we are using V5 but I cant seem to find the parameter to check rendering.
Could you please point me to the right direction.

@deed02392
Copy link

Bump. Where do we configure this?

@masterlittle
Copy link

masterlittle commented Mar 4, 2020

Its actually in the organization table in the database. You will have to edit that table entry. Redash stores this setting on startup.

For fresh installs only -->
There are two env variables which can be set -

REDASH_INTEGER_FORMAT="00"
REDASH_FLOAT_FORMAT="00.00"

This will remove the commas in the formatter.

@faridskyman
Copy link

Maybe a little late but I ran into the same issue and solved it by casting the id-column to char.
In your case: SELECT CAST(id as CHAR(8)) as id FROM test;
Hacky "but it works" ;)

this solves my problem.. thx!

@eradman
Copy link
Collaborator

eradman commented Oct 27, 2022

@faridskyman: as @masterlittle suggested you can update the organizations table to make change the number format

UPDATE organizations SET settings = jsonb_set(settings::jsonb, '{settings,float_format}', '"0.0"', true);
UPDATE organizations SET settings = jsonb_set(settings::jsonb, '{settings,integer_format}', '"0"', true);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants