UFN_RESOURCE_CALCULATEPERTICKETQUANTITY_2
Return
Return Type |
---|
int |
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@DIVIDEND | int | IN | |
@DIVISOR | int | IN |
Definition
Copy
create function dbo.UFN_RESOURCE_CALCULATEPERTICKETQUANTITY_2
(
@DIVIDEND int,
@DIVISOR int
)
returns int
as begin
declare @QUANTITY float = @DIVIDEND / cast(@DIVISOR as float);
declare @WHOLENUMBER int = @QUANTITY;
declare @ADJUSTMENT int = case when @QUANTITY = @WHOLENUMBER then 0 else 1 end;
return @WHOLENUMBER + @ADJUSTMENT;
end