using self.sc.SetValue(2.3), but get integer from self.sc.GetValue()

Hi, I input float value

    [self.sc](http://self.sc) = wx.SpinCtrl(self, -1, '',  (150, 75), (60, -1))
    self.sc.SetRange(-459.0, 1000.0)
    self.sc.SetValue(2.3)

but I found I got integer:
fahr = self.sc.GetValue()
print “fahr =”,fahr

fahr = 2

I found it always rounds to an integer, what’s wrong ?

Thanks
Xiaojian

Andrea wrote the floatSpin control. It works very well. I've attached a
copy of floatSpin.py.

   If you use it with data to be written to a database table (e.g., SQLite3),
the variable must be explicitly cast to a REAL before writing the data to
the database table. That threw me for a bit.

Rich

floatSpin.py (40.1 KB)

···

On Wed, 18 Apr 2007, Josiah Carlson wrote:

Nothing is wrong, that's precisely what it is supposed to do. The
underlying control only handles integer values. I believe that someone
has written a spin control that handles floats, but I can't find the link
right now.

--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc. | Accelerator(TM)
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863