Function overview
Prototype
Terms_Amount (
Amount; Periods; Value )
Parameters
Amount This is for the sum that needs to be divided up
Periods Number of divisions (terms) the amount is divided into.
Value Specifies which of the two number generated to retrieve.
Description
This is used to figure the proper amount to be applied when figuring out terms. In the example, simply dividing 2267 by 3 payments would result in 755.6666666667. Using this function will result in two answers depending on the parameter passed. Passing the parameter of "low" give you the low amount and passing "high" will give you the higher amount.
Examples
Sample input
Term_Amount ( 2267 ; 3 ; "low" )
Sample output
755
Function code
Let
(
[
$integer = Abs ( Amount ) ;
$decimal = Amount - $integer ;
$remainder = Mod ( $integer ; Periods ) ;
$extra = $remainder + $decimal ;
$period_value_low = ($integer - $remainder) / Periods ;
$period_value_high = $period_value_low + $extra
];
Case
(
Value = "low" ; $period_value_low ;
Value = "high" ; $period_value_high
)
)
// ===================================
/*
This function is published on FileMaker Custom Functions
to check for updates and provide feedback and bug reports
please visit http://www.fmfunctions.com/fid/205
Prototype: Terms_Amount( Amount; Periods; Value )
Function Author: Drew Sanderson (http://www.fmfunctions.com/mid/157)
Last updated: 19 February 2009
Version: 1
*/
// ===================================
Let__LITBR__(__LITBR__[__LITBR__$integer = Abs ( Amount ) ;__LITBR__$decimal = Amount - $integer ;__LITBR__$remainder = Mod ( $integer ; Periods ) ;__LITBR__$extra = $remainder + $decimal ;__LITBR__$period_value_low = ($integer - $remainder) / Periods ;__LITBR__$period_value_high = $period_value_low + $extra__LITBR__];__LITBR____LITBR__Case__LITBR__(__LITBR__Value = "low" ; $period_value_low ;__LITBR__Value = "high" ; $period_value_high__LITBR__)__LITBR____LITBR__)__LITBR____LITBR__// ===================================__LITBR__/*__LITBR____LITBR__ This function is published on FileMaker Custom Functions__LITBR__ to check for updates and provide feedback and bug reports__LITBR__ please visit http://www.fmfunctions.com/fid/205__LITBR____LITBR__ Prototype: Terms_Amount( Amount; Periods; Value )__LITBR__ Function Author: Drew Sanderson (http://www.fmfunctions.com/mid/157)__LITBR__ Last updated: 19 February 2009__LITBR__ Version: 1__LITBR____LITBR__*/__LITBR__// ===================================
Login or register to comment
Create a new account with fmcustomfunctions.com or login to post a comment.