Perl
sub returns {
  my $buy = $_[0];
  my $now = $_[1];

  # (현재가 - 구입가) / 구입가 * 100 - 세금
  return sprintf("%.3f", ($now - $buy) / $buy * 100 - 0.315);
}
Retrieved from http://hyacinth.byus.net/moniwiki/wiki.php/수익률 계산
last modified 2014-04-25 17:40:35