RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Currency Calculations in Ruby

You’re doing some currency calculations in your app. It seems to be working well. But after a while, strange discrepancies emerge. The books stop balancing. People get mad. All because the code treated currency like any other number. In this article, Julio Sampaio shows us which of Ruby’s number classes are unsuitable for currency, and walks us through better options. https://www.honeybadger.io/blog/ruby-currency/

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in