Added flag to force creation of real number instead of integer fields. Originally from Kristian Jones, refactored by me