1

I'm using GTK# and the built in gtk.TreeView to create a data grid. I have a column that is populated with floats. Right now they display as 120.00000. I would like to have these floats display with only two digits of precision :

not this -> 120.00000

this -> 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)

How can I set this property?

Andre P.
  • 613
  • 1
  • 7
  • 21

0 Answers0