0

I have columns with numeric(5,2) data type.

When the actual data is 1.25, it displays correctly as 1.25.

When the actual data is 1.00, it displays as 1.

Can anyone tell me why? Is there something that I need to set to have it so the two decimal 0's display?

Murtuza Z
  • 5,639
  • 1
  • 28
  • 52
Katydid
  • 331
  • 1
  • 2
  • 7

2 Answers2

0

I think this may be an issue specific to pgadmin4. Consider:

> createdb test
> psql -d test
psql (9.4.9)
Type "help" for help.

test=# create table mytest(id serial not null primary key, name varchar(30),salary numeric(5,2));
CREATE TABLE
test=# select * from mytest;
 id | name | salary 
----+------+--------
(0 rows)
test=# insert into mytest(name,salary) values('fred',10.3);
INSERT 0 1
test=# insert into mytest(name,salary) values('mary',11);
INSERT 0 1
test=# select * from mytest;
 id | name | salary 
----+------+--------
  1 | fred |  10.30
  2 | mary |  11.00
(2 rows)
test=# select salary from mytest where name = 'mary';
 salary 
--------
  11.00
(1 row)

This example is with version 9.4 as you can see, but would be a simple test to see if the problem is with 9.6 or pgadmin4. In pgadmin3 the value is displayed correctly with decimal places. Last time I tried pgadmin4 it had a number of annoying issues that sent me scurrying back to pgadmin3 for the time being. However there is a list where you can seek confirmation of the bug: https://redmine.postgresql.org/projects/pgadmin4

Colin Beckingham
  • 527
  • 3
  • 11
0

This is a bug with pgAdmin4 and already reported https://redmine.postgresql.org/issues/2039

Murtuza Z
  • 5,639
  • 1
  • 28
  • 52