Project

roundest

0.0
No commit activity in last 3 years
No release in over 3 years
Given a range between two floating point numbers, find one of the 'roundest' (i.e. shortest, or ending in 5) numbers that are strictly within the range."
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 10.0
>= 0
 Project Readme

roundest

A gem for finding the roundest number between two floats.

Roundest returns its own class of number, Floteger, in order to preserve its roundness. It is intended to be used when you are ultimately looking for pretty, i.e. string output rather than for further computation.

Install

sudo gem install roundest

Use

require 'roundest'

Roundest::roundest(0.00371, 0.00379).to_s
=> "0.00375"

Licence

Copyright Dan Hetherington 2018, released under the GPL 3.0.