principal numeric, rate numeric, days integer, round_up integer
Owner
postgres
Result Type
numeric
Description
Implementation: core.calculate_interest
CREATE OR REPLACE FUNCTION core.calculate_interest(principal numeric, rate numeric, days integer, round_up integer)
RETURNS numeric
LANGUAGE plpgsql
IMMUTABLE STRICT
AS $function$
DECLARE num_of_days_in_year integer = 365;
BEGIN
IF core.is_leap_year() THEN
num_of_days_in_year = 366;
END IF;
RETURN core.calculate_interest(principal, rate, days, round_up, num_of_days_in_year);
END
$function$