i want to place negative value in bracket like -2000 to (2000)
for that i made a which is converting -1361236.75886298 to (1.36124e+006)
the function that i made for this is :
ALTER function [dbo].[IsNegative](
@Number NVARCHAR (500)
)
Returns nvarchar (200)
as
begin
Declare @Number2 FLOAT
set @Number2=Cast (@Number as float)
Declare @result nvarchar (200)
if ( @Number2 <=0.0)
begin
Set @result='('+Substring (@Number,2,len(@Number))+')'
end
else
begin
Set @result = @Number
end
return @result
end
i want accurate answere thanx in advance