Real (function)


 * This article is about the Game Maker Function real, for information about the data type in Game Maker, see Real

Error
When this function is fed a string that is not correctly formatted it will return the error Error in function real. The correct format for a GM compatible number is this regular expression: ^[\+\-]?(\d+(\.\d*)?|\.\d+)([Ee][\+\-]?\d+)?$ (read that as: An optional plus or minus sign followed by zero or more digits followed by an optional dot and a minimum of 1 digit. That all followed by an optional E or e [the 'exponent'] followed by an optional plus or minus sign followed by any number of digits.)