I've been copying a variation of this snippet into most Ruby projects:

class BigDecimal
def inspect
"BigDecimal(\"#{to_s(?F)}\")"
end
end

It overrides the default appearance of a BigDecimal in an irb/pry/rails console. Why?

1. Easier to visually scan than exponential notation
2. Can be copy-pasted to get another bigdecimal (otherwise using exp notation yields a Float instance)

#ruby #rubytips