-
Notifications
You must be signed in to change notification settings - Fork 361
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
numbers displayed as 1.450817032e+ #448
Comments
Thanks for reporting this. Not sure what the issue is, I'll look into it. |
This appears to be working; can you share more information about the table/query you were using? My guess is that this was returned back not as the type you expected. |
With / without the $ usql -P numericlocale=on pg:// -c "select '1450817.032'::real"
Connected with driver postgres (PostgreSQL 16.1 (Debian 16.1-1.pgdg120+1))
float4
-------------
1,450,817.0
(1 row)
$ usql pg:// -c "select '1450817.032'::real"
Connected with driver postgres (PostgreSQL 16.1 (Debian 16.1-1.pgdg120+1))
float4
--------------
1.450817e+06
(1 row) |
It is working like you showing, and like I like show earlier, but what I am asking for it should be displayed as 1450817.0 without the thousands separator |
Compare the output for the following script: select '1251258098.1555901285'::numeric;
select '1251258098.1555901285'::float4;
select '1251258098.1555901285'::float8;
select '1251258098.1555901285'::double precision; With $ psql -f f.sql postgres://postgres:P4ssw0rd@localhost
numeric
-----------------------
1251258098.1555901285
(1 row)
float4
---------------
1.2512581e+09
(1 row)
float8
------------------
1251258098.15559
(1 row)
float8
------------------
1251258098.15559
(1 row) With $ usql -f f.sql postgres://postgres:P4ssw0rd@localhost
numeric
-----------------------
1251258098.1555901285
(1 row)
float4
---------------
1.2512581e+09
(1 row)
float8
----------------------
1.25125809815559e+09
(1 row)
float8
----------------------
1.25125809815559e+09
(1 row) The differences here are in the difference between how Go and C treat their numeric formatting. I agree Go seems to be wrong here for extremely large numbers, and I'll look into seeing if we can get something closer to In the interim, I would suggest casting your number as a string, or to the (caveat: apologies in advance if I'm mistaken about |
numbers displayed as "1.450817032e+" it should be displayed as 1450817.032,
tried to use -P numericlocale=on, this displayed as 1,450,817.032, but we required to be displayed as 1450817.032
The text was updated successfully, but these errors were encountered: