MrTV
asked on
round to 2 digit in postgres
((((t."Open" + t.lag_start) - ((2)::numeric * (t."Open" - h.value))) * (100)::numeric) / t."Open") AS perprofit,
the result is 2.487582758758 I want only 2.49
I try this one but it error
the result is 2.487582758758 I want only 2.49
SELECT t."Date",
t."Open",
t.name,
t."Low",
t.chg,
t.lag_start,
((t."Open" + t.lag_start) - ((2)::numeric * (t."Open" - h.value))) AS profit,
((((t."Open" + t.lag_start) - ((2)::numeric * (t."Open" - h.value))) * (100)::numeric) / t."Open") AS perprofit,
h.value,
h.value AS gap
FROM ("chgView" t
JOIN helpertable h ON ((((t."Open" - t."Low") - h.value) >= (0)::numeric)));
I try this one but it error
SELECT t."Date",
t."Open",
t.name,
t."Low",
t.chg,
t.lag_start,
((t."Open" + t.lag_start) - ((2)::numeric * (t."Open" - h.value))) AS profit,
round(((((t."Open" + t.lag_start) - ((2)::numeric * (t."Open" - h.value))) * (100)::numeric) / t."Open").,2 )AS perprofit,
h.value,
h.value AS gap
FROM ("chgView" t
JOIN helpertable h ON ((((t."Open" - t."Low") - h.value) >= (0)::numeric)));
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Because it's followed by another column selection ?