Module: NumericValue
- Extended by:
- Entity
- Defined in:
- lib/rbbt/rest/common/table.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.tsv_sort(v) ⇒ Object
113 114 115 116 117 118 119 120 |
# File 'lib/rbbt/rest/common/table.rb', line 113 def self.tsv_sort(v) value = v.last if Array === value value.first.to_f else value.to_f end end |
Instance Method Details
#<=>(other) ⇒ Object
105 106 107 108 109 110 111 |
# File 'lib/rbbt/rest/common/table.rb', line 105 def <=>(other) if Float === self super(other.to_f) else self.to_f <=> other.to_f end end |
#to_s ⇒ Object
122 123 124 |
# File 'lib/rbbt/rest/common/table.rb', line 122 def to_s "%.5g" % self.to_f end |