--:SetVar Function "AUX:IntSign.DecMoney"
if exists( select * from [sysobjects] (nolock) where [type] in ('FN','TF') and [name]=N'AUX:IntSign.DecMoney' )
   drop function [AUX:IntSign.DecMoney]
GO
/* Translated by $SQLTRANS utility (SQL-file technology). Method author: Sergei Y.Kitáev.
** Script translation date-time: 2022-11-27 00:29:27.24 (stamp of SQL-file generation). */
create function [AUX:IntSign.DecMoney]( @Value decimal(19,4) )
returns int
BEGIN
/*==================================================================================================
# SQLAUX scripting library | Author: Sergei Y.Kitáev
----------------------------------------------------------------------------------------------------
#
# INTEGER SIGN FOR VALUE (“$(dt_DecMoney_AUX)” ARG.TYPE):
#
# === Usage: ===
# dbo.[AUX:IntSign.DecMoney]( <Value> )
#
==================================================================================================*/

if @Value is null return null

return
   case
      when @Value > 0 then  1
      when @Value < 0 then -1
      else 0
   end

/*================================================================================================*/
END
GO
/*
select dbo.[AUX:IntSign.DecMoney]( 123.567 ) 'Integer sign (dec.money)'
select dbo.[AUX:IntSign.DecMoney]( -123.567 ) 'Integer sign (dec.money)'
select dbo.[AUX:IntSign.DecMoney]( 0 ) 'Integer sign (dec.money)'
select dbo.[AUX:IntSign.DecMoney]( null ) 'Integer sign (dec.money)'
*/
