diff options
author | Christoph Helma <helma@in-silico.ch> | 2010-07-20 11:31:27 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2010-07-20 11:31:27 +0200 |
commit | 5f243f1e9e0a8e12cd8a2267bcec3140d21bf445 (patch) | |
tree | e755d51a453ed710dd4d78437b197c408d5687eb /report/validation_data.rb | |
parent | 2963e4f7c355394130297ad181cd30f5e78d1017 (diff) | |
parent | 2a4fe800d1fad7da3a835f664ce1af864e827c0f (diff) |
Merge commit 'mguetlein/test'
Conflicts:
application.rb
Diffstat (limited to 'report/validation_data.rb')
-rw-r--r-- | report/validation_data.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/report/validation_data.rb b/report/validation_data.rb index d87e491..0a25e87 100644 --- a/report/validation_data.rb +++ b/report/validation_data.rb @@ -19,7 +19,13 @@ end class Object def to_nice_s - return "%.2f" % self if is_a?(Float) + if is_a?(Float) + if self>0.01 + return "%.2f" % self + else + return self.to_s + end + end return collect{ |i| i.to_nice_s }.join(", ") if is_a?(Array) return collect{ |i,j| i.to_nice_s+": "+j.to_nice_s }.join(", ") if is_a?(Hash) return to_s |