Wednesday, February 28, 2018

Add $ symbol to column values

To add $ symbol to column values and convert the column values to western number system
Example 1.
declare @value int = 4255
select '$ ' + replace(convert(varchar(100), convert(money, @value), 1), '.00', '')

-- output: $ 4,255

Example 2
declare @value Decimal(18,2)= 5488.00
select '$ ' + convert(varchar(100), convert(money, @value), 1)

-- output: $ 5488.00

No comments:

Change default Port on Next.js app

 If any other app or process is running on port 3000 , you will get this error in your terminal Port 3000 is already in use. error Command f...