improved number conversion