Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/smt/fractions

A Rails plugin that adds simple fraction support to instances of Float.
https://github.com/smt/fractions

Last synced: about 2 months ago
JSON representation

A Rails plugin that adds simple fraction support to instances of Float.

Awesome Lists containing this project

README

        

fractions
=========

Adds a 'to_fraction' method to Float, e.g., (0.5).to_fraction => [1,2].

Originally a snippet by Michelle/shell (http://snippets.dzone.com/posts/show/3636), now ported to a Rails plugin.

I've also prepared a simple helper module that mixes a 'nice_fraction' method into ActionView::Base.

Copyright (c) 2008 Stephen Tudor, released under the MIT license