How to limit number of decimal places to be displayed in Gtk CellRendererText
问题 I am trying to limit the amount of decimal places shown in a Gtk.CellRendererText. Currently a float number field is shown with 6 decimal places, but I would like to have just 1. This test code should work on Linux: #!/usr/bin/python3 from gi.repository import Gtk class MyWindow(Gtk.Window): def __init__(self): Gtk.Window.__init__(self, title="Hello World") self.set_default_size(200, 200) self.liststore = Gtk.ListStore(float) treeview = Gtk.TreeView(model=self.liststore) self.liststore.append