Supporting fractions in Ruby/Rails

Unicode comes with a selection of common single-character fractions like ½, ¼, and even ⅐ (see en.wikipedia.org/wiki/Number_Forms for more), but I need to store and display somewhat arbitrary fractions in a Rails app and it isn’t something I’ve had to do before so I’m documenting my workings.Ruby has the Rational class that makes it easy to work with fractions and can perform a specific calculation I need (½ ⅐ = ⁹⁄₁₄):.
Supporting fractions in Ruby/Rails #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/supporting-fractions-in-ruby-rails

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles