Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DECIMAL FUNCTIONS 1

Status
Not open for further replies.

cristi22

MIS
Aug 17, 2005
155
US
hello all -
How do i convert the result of the multiplication to decimal?
Code:
SELECT QUANTITY,  (QUANTITY *RATE) AS RATE1,RATE 
FROM MEMBER_WORK_PERIOD_FUND WHERE MEMBER_KEY AND FUND='GNYPF' AND APP='HW'

dec((QUANTITY *RATE),2,2) did not work

Now the result=59.400000, should be = 59.40

thanks a lot for help!
cristi:)
 
Try dec((QUANTITY *RATE),4,2). The first number represents the total number of digits including the decimal place.

As a test, I ran
Code:
select dec(5.23*4.34546,4,2) from geniusdata.pm_policy_master;
I got 22.72 as my result. BTW I ran it on v8.2.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top