Module: Formulas::FrequencyConversions
- Included in:
- Salary, Superannuation, WithholdingTax
- Defined in:
- lib/formulas.rb
Instance Method Summary collapse
- #convert_annually_to_annually(number) ⇒ Object (also: #convert_weekly_to_weekly, #convert_fortnightly_to_fortnightly, #convert_monthly_to_monthly)
- #convert_annually_to_fortnightly(number) ⇒ Object
- #convert_annually_to_monthly(number) ⇒ Object
- #convert_annually_to_weekly(number) ⇒ Object
- #convert_fortnightly_to_annually(number) ⇒ Object
- #convert_fortnightly_to_monthly(number) ⇒ Object
- #convert_fortnightly_to_weekly(number) ⇒ Object
- #convert_monthly_to_annually(number) ⇒ Object
- #convert_monthly_to_fortnightly(number) ⇒ Object
- #convert_monthly_to_weekly(number) ⇒ Object
- #convert_weekly_to_annually(number) ⇒ Object
- #convert_weekly_to_fortnightly(number) ⇒ Object
- #convert_weekly_to_monthly(number) ⇒ Object
Instance Method Details
#convert_annually_to_annually(number) ⇒ Object Also known as: convert_weekly_to_weekly, convert_fortnightly_to_fortnightly, convert_monthly_to_monthly
28 29 30 |
# File 'lib/formulas.rb', line 28 def convert_annually_to_annually(number) number end |
#convert_annually_to_fortnightly(number) ⇒ Object
43 44 45 |
# File 'lib/formulas.rb', line 43 def convert_annually_to_fortnightly(number) number.to_f / 26 end |
#convert_annually_to_monthly(number) ⇒ Object
39 40 41 |
# File 'lib/formulas.rb', line 39 def convert_annually_to_monthly(number) number.to_f / 12 end |
#convert_annually_to_weekly(number) ⇒ Object
35 36 37 |
# File 'lib/formulas.rb', line 35 def convert_annually_to_weekly(number) number.to_f / 52 end |
#convert_fortnightly_to_annually(number) ⇒ Object
71 72 73 |
# File 'lib/formulas.rb', line 71 def convert_fortnightly_to_annually(number) number.to_f * 26 end |
#convert_fortnightly_to_monthly(number) ⇒ Object
79 80 81 |
# File 'lib/formulas.rb', line 79 def convert_fortnightly_to_monthly(number) (number.to_f * 26) / 12 end |
#convert_fortnightly_to_weekly(number) ⇒ Object
75 76 77 |
# File 'lib/formulas.rb', line 75 def convert_fortnightly_to_weekly(number) number.to_f / 2 end |
#convert_monthly_to_annually(number) ⇒ Object
59 60 61 |
# File 'lib/formulas.rb', line 59 def convert_monthly_to_annually(number) number.to_f * 12 end |
#convert_monthly_to_fortnightly(number) ⇒ Object
67 68 69 |
# File 'lib/formulas.rb', line 67 def convert_monthly_to_fortnightly(number) number.to_f * 12 / 26 end |
#convert_monthly_to_weekly(number) ⇒ Object
63 64 65 |
# File 'lib/formulas.rb', line 63 def convert_monthly_to_weekly(number) number.to_f * 12 / 52 end |
#convert_weekly_to_annually(number) ⇒ Object
47 48 49 |
# File 'lib/formulas.rb', line 47 def convert_weekly_to_annually(number) number.to_f * 52 end |
#convert_weekly_to_fortnightly(number) ⇒ Object
55 56 57 |
# File 'lib/formulas.rb', line 55 def convert_weekly_to_fortnightly(number) number.to_f * 52 / 26 end |
#convert_weekly_to_monthly(number) ⇒ Object
51 52 53 |
# File 'lib/formulas.rb', line 51 def convert_weekly_to_monthly(number) number.to_f * 52 / 12 end |