Skip to content

Instantly share code, notes, and snippets.

@t0d0r
Last active January 4, 2020 14:28
Show Gist options
  • Save t0d0r/d8d626f29d425c73c9d90be2df92d784 to your computer and use it in GitHub Desktop.
Save t0d0r/d8d626f29d425c73c9d90be2df92d784 to your computer and use it in GitHub Desktop.
divident
# vim:filetype=ruby
p = 1641.23
p = 1914.77
cd = (p * ( 10.00/100 ))
dd = ((p-cd)*( 5.00/100 ))
cash = p - cd - dd
puts "=" * 60
puts ("%8.2f - %8.2f - %8.2f = %8.2f" % [ p, cd, dd, cash ]).center(60).rstrip
puts ("%8s - %8s - %8s = %8s" % %w(сума печалба дивидент крайна) ).center(60).rstrip
puts ("%8s - %8s - %8s = %8s" % %w(сума 10% 5% крайна) ).center(60).rstrip
puts "=" * 60
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment