fltk::FloatInput | +----fltk::IntInput
#include <fltk/IntInput.h>
You may want a fltk::ValueInput widget instead. It has value() methods that take and return double values rather than strings.
If you change when() to fltk::WHEN_ENTER_KEY the callback is only done when the user hits the up/down arrow keys or when the user types the Enter key. This may be more useful than the default setting of fltk::WHEN_CHANGED which can make the callback happen when partially-edited numbers are in the field.