Converstion Text data type to Decimal

smcsmc Member Posts: 41
How we can convert a text data type to decimal
Eg:

codnumber (datatype code value '10.56')
i want to convert to decimal value 10.56
is it possible then how.
Hoping Realy


SMC

Comments

  • NRNR Member Posts: 78
    This can be acheived using the Evaluate() ....

    TextVar := '10.56'

    EVALUATE(<DecimalVar>,<TextVar>)

    Evaluate function returns true or false and hence should be used with an IF condition.
  • smcsmc Member Posts: 41
    you will get only true or fale?
    but i want to get that value only from text data type no need to check that data type
  • NRNR Member Posts: 78
    EVALUATE()
    If you omit the optional return value and an error occurs during the evaluation of the string, a run-time error occurs. If you include it, the system assumes you will handle any errors.

    The text value will be converted to decimal and will be stored in the first parameter provided to the function i.e. DecimalVar
Sign In or Register to comment.