public
Description: A helper that can format a number into a fraction.
Homepage: http://www.aeonscope.net
Clone URL: git://github.com/aeonscope/number_to_fraction.git
README.rdoc

Overview

A helper that can format a number into a fraction. Unfortunately, this only handles the "pretty printing" of fractions less than 1/10th at the moment (as a better algorithm needs to be used for more complex number cases).

License

Copyright © 2009 Brooke Kuhlmann of Berserk Technologies. See the included LICENSE for more info.

History

See the CHANGELOG file for more info.

Requirements

  1. Ruby on Rails.

Installation

Type the following from the command line to install:

  • UNIX: sudo gem install aeonscope-number_to_fraction
  • Windows: gem install aeonscope-number_to_fraction

Update your environment.rb file to include the new gem:

  • config.gem "aeonscope-number_to_fraction", :lib => "number_to_fraction", :source => "gems.github.com"

Usage

Example:

  number_to_fraction 3.75

Result:

  3 3/4

View the Rspec test suite for more usage and examples.

Contact/Feedback/Issues