Description

Properties

Name Value
ANSI Nulls ON

True

Quoted Identifier ON

True

Encrypted

True

Execute As
Null on Null Input

False

Schema Bound

False

Assembly

Parameters

Name Data Type Length Description
(Result) float 8
@value float 8
@maxafterDecimal int 4

SQL Script

SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE FUNCTION dbo.TOUP (
@value float,
@maxafterDecimal int  )

RETURNS float
WITH encryption ,
EXECUTE AS CALLER

AS
BEGIN
declare @iv float
  
 if (@value is null) or @value=0
 begin
  set @iv= 0
  end
 else
 begin

  set @iv = @value * ( cast( '1' + REPLACE(space(@maxafterDecimal),' ','0') as float))
 if @iv- FLOOR(@iv) >0
 set @iv=FLOOR(@iv)+1
   
 set @iv=@iv/( cast( '1' + REPLACE(space(@maxafterDecimal),' ','0') as float))
 end
   return @iv
END;
 
GO

Depends On

No items found