GtkSpinButton::get_value_as_float

double get_value_as_float(void);

Retrieves the current value displayed in the spinbutton entry as a float value. Use this in combination with the PHP function round() where you need to collect the value to a specific number of decimal places.

<?php

$adj = &new GtkAdjustment(0.0, 0.0, 1.0, 0.01, 0.1, 0.0);
$spin = &new GtkSpinButton($adj, 0.0, 2);

round($spin->get_value_as_float(), 2);

?>