Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Vaishu
Posting Yak Master
178 Posts |
Posted - 2007-08-10 : 04:36:49
|
| HiI have datacloum called 'price' (float) and using the below code in my stored procedurecast(price * 1.175 as decimal(19, 2)) as [item-price]I am getting the price as (ex1: 23.58, ex2: 114.25, ....etc)So How do I round the value(price) to (ex1: 23.99, ex2: 114.99)Advance thanks |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2007-08-10 : 04:43:33
|
ahhh..... a retailer :)CAST(CAST(cast(Price * 1.175 as decimal(19, 2)) as INT) + 0.99 AS DECIMAL(19, 2)) as [item-price]Duane. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-08-10 : 05:29:15
|
[code]ceiling(cast(price * 1.175 as decimal(19,2))) - 0.01[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
Vaishu
Posting Yak Master
178 Posts |
Posted - 2007-08-10 : 07:28:09
|
| HiThanks a lot. It works |
 |
|
|
|
|
|