Question

I am using MS SQL 2008 to develop one system with Classic ASP.

I want to show 3 Decimal Places the field Datatype is money. I got answer from this http://www.sqlusa.com/bestpractices2005/moneyformat/ .

I use like this in my SQL Statement :

        CONVERT(VARCHAR, CAST(Sell_Price AS Decimal(19, 3))) AS Unit_Price

What I want to know is: Is there more effective way(in performance and usage) than my current one? If there is, please show me. Thanks in advance!

Regards,

RedsDevils

Was it helpful?

Solution

Personally, I'd consider returning the value as-is unformatted from the database and formatting it for display in the UI instead - leave the formatting up to the front end. After all, the db doesn't know for what use the data it returns is being used for - e.g. something else that runs the query may want the full accuracy returned so would save having multiple different versions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top