我使用GTK#和内置gtk.TreeView
来创建数据网格。我有一个填充浮动的列。现在他们显示为120.00000。我想让这些浮点数只显示两位数的精度:
不是这个 - > 120.00000
这 - > 120.00
let tree = new Gtk.TreeView ()
// Create a column for the price name
let priceColumn = new Gtk.TreeViewColumn ()
do priceColumn.Title <- "Price";
do priceColumn.Expand <- true
do priceColumn.Alignment <- 0.5f
let priceNameCell = new Gtk.CellRendererText ()
do priceNameCell.Alignment <- Pango.Alignment.Center
do priceNameCell.Xalign <- 0.5f
do priceColumn.PackStart (priceNameCell, true)
do priceColumn.AddAttribute (priceNameCell, "text", 1)
如何设置此属性?