Add beforeValidate() and isWholeNumber() to handle cost conversion