Navigation: Developing Apps > BINETIX® AGE™ API > The Node > Toolkits > age_math
fraction/2
Description
fraction/2 is an Erlang function exported by "age_math" module.
Returns fraction of a number value.
The function is useful to calculate a part (Fraction) as a percent of another part (Total).
References
•percent/2
Parameters
Name
Type
Percent
number()
Percentage as floating point.
Total
Total number
Result
Value or Type
Returns the calculated fraction of Total.
Code Sample
> age_math:fraction(12.55, 200). 25.1