Created
February 24, 2011 22:52
-
-
Save DGaffney/843067 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bling = {"blah"=>0.0038, "bloo"=>0.01} | |
| bling.each_pair do |name, value| | |
| val = sprintf( "%.02f" , value).to_s.to_f | |
| bling[name] = val if val!=0 | |
| end | |
| puts bling.inspect | |
| => {"blah"=>0.0038, "bloo"=>0.01} #does this? WTF? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment