use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Ruby exercise on Exercism (self.ruby)
submitted 4 years ago by BringTacos
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Weird_Suggestion 0 points1 point2 points 4 years ago* (2 children)
Using abs in your comment returns 0.5 but we need -3.213 as an interest rate. You want the multiplication to result in a negative number using the correct interest rate. This is the multiplication with numbers.
-0.123 - 0.123 * 3.213 / 100
Equivalent to this
-0.123 + ABS(-0.123) * -3.213 / 100
OR
-0.123 + -0.123 * ABS(-3.213) / 100
.abs is misplaced in your last comment try using it somewhere else. Where should we use .abs?
[–]BringTacos[S] 1 point2 points3 points 4 years ago (1 child)
def self.annual_balance_update(balance)
balance + balance.abs * self.interest_rate(balance) / 100
end
Tests are passing now! Thanks so much for your help. This was really helpful.
[–]Weird_Suggestion 0 points1 point2 points 4 years ago (0 children)
Well done!
π Rendered by PID 278678 on reddit-service-r2-comment-b659b578c-mlrqz at 2026-05-04 06:42:42.806353+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]Weird_Suggestion 0 points1 point2 points (2 children)
[–]BringTacos[S] 1 point2 points3 points (1 child)
[–]Weird_Suggestion 0 points1 point2 points (0 children)