There are many methods and features that you can use in Delphi with math functions for easy application development. Type conversion functions in Delphi are used to switch data between different types of variables. StrToInt Function: It is used to convert the values containing the string to the integer type. An information with an alphanumeric value must be written into the function. Most of these issues are in our code example.


Source code for debit and balance account transactions with Delphi:

DECLARE @ALACAK MONEY
DECLARE @BORC MONEY
DECLARE
@BAKIYE MONEY
DECLARE @FKOD varchar
DECLARE @AL_DEGER MONEY
DECLARE
@BRC_DEGER MONEY
DECLARE @FTIP varchar
Declare @CKOD varchar
Set @FKOD
= @FKOD
Set @FTIP = @FTIP
Set @CKOD = @CKOD
Set @BAKIYE = Cast((Select
Sum(BAKIYE) from T_Finans Where KOD = @FKOD) as Money)
if (@FTIP =
‘4’)
BEGIN
Set @AL_DEGER = (cast(@AL_DEGER as money))
Set @BAKIYE =
(Cast((Select BAKIYE from T_Cari Where KOD = @CKOD) as Money))
Set @ALACAK =
(Cast((Select ALACAK From T_Cari Where KOD=@CKOD)+ @AL_DEGER as
Money))
Update T_Cari Set BAKIYE = BAKIYE + @ALACAK Where KOD =
@CKOD
Insert Into T_Finans (ALACAK,FKOD,BAKIYE,KOD,CTIP) Values
(@ALACAK,@FKOD,@BAKIYE+@ALACAK,@CKOD,2)
end
ELSE
IF (@FTIP =
‘5’)
BEGIN
Set @BRC_DEGER = (cast(BRC_DEGER as MOney))
Set @BAKIYE =
Cast((Select Sum(BAKIYE) from T_Finans Where KOD = @FKOD) as Money)
Set @BORC
= (Cast((Select BORC From T_Cari Where KOD=@CKOD)+ @BRC_DEGER as
Money))
Update T_Cari Set BAKIYE = BAKIYE – @BORC Where KOD = @CKOD
Insert
Into T_Finans (BORC,FKOD,BAKIYE,KOD,CTIP) Values
(@BORC,@FKOD,@BAKIYE-@BORC,@CKOD,2)
END
Go