/****** Object:  UserDefinedFunction [dbo].[ValueOfCashInFormdata]    Script Date: 30/06/2021 09:58:25 ق.ظ ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

-- =============================================
-- Author:		Azimi
-- Create date: 1396/05/05
-- Description:	
-- =============================================
ALTER FUNCTION [dbo].[ValueOfCashInFormdata] 
(
	@FormData nvarchar(1000)
)
RETURNS DECIMAL(28,5)
AS
BEGIN
	DECLARE @Result DECIMAL(28,5)

	DECLARE @Index as integer
	SET @Index = 1
	while @Index < 5
	begin
		--print @FormData
		set @FormData = Substring(@FormData,CHARINDEX(';',@FormData)+1, 1000)
		set @Index = @Index+1
	end
	SELECT @Result =CAST( REPLACE(LEFT(@FormData,CHARINDEX(';',@FormData)-1),'/','.') as decimal(28,5))

	RETURN @Result

END