jRuby's Float to represent in JTable's cell
- by guai
Hello.
I need to represent floats in jTable formatted.
When I do tbl.model.add_row [obj, 1.3524632478].to_java, obj is represented as it's to_s method's return value, but float do not. Overriding float's to_s method does nothing.
I want floats to be formatted like this
class Float
def to_s
sprintf("%.2f", self)
end
end
in all my tables.