You should check for all non numeric chars and decide what to do with malformed strings.