When I use these selections I have zeros after comma, how can I get the result I expect
select concat(5678.0/1000,'');
select (5678.0/1000)::text;
both gives : 5.6780000000000000
what i need is this : 5.678
When I use these selections I have zeros after comma, how can I get the result I expect
select concat(5678.0/1000,'');
select (5678.0/1000)::text;
both gives : 5.6780000000000000
what i need is this : 5.678
3
Answers
kindly run this:
rtrim
the unwanted trailing decimal positions. A check is needed if the number has decimal point so that you do not eliminate relevant zeroes (as in1000
)You can use
TRIM(TRAILING FROM <string>, <chars>)
. For example: