UNPKG
@bmancini55/finance
Version:
latest (0.1.5)
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
Finance utilities for JavaScript
@bmancini55/finance
/
lib
/
calc-return.ts
7 lines
(6 loc)
•
164 B
text/typescript
View Raw
1
2
3
4
5
6
7
/** * Returns the gain or loss percentage */
export
function
calcReturn
(
principal
:
number
,
gain
:
number
):
number
{
return
(principal + gain) / principal -
1
; }