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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

arithmetic rounding

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi
amount1 is character(18)
amount2 is numeric
I cannot redefine their data types.

When the multiplication takes place, we get 27397.416.
When the division takes place, we get 2.73.

How can I round up to 2.74 when greater than 2.73500000 ?

select "amount1"=amount1,
"amount2"=amount2,
"computamount"=ltrim(convert(char(20),convert(numeric(17,2), convert(numeric(13,6), amount1) * amount2 / 10000 )))
from etc etc

amount1 amount2 computamount
------------------ ----------------- -------------
00000000000.184000 148899 2.73

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top