MTON( ) Function

Returns a Numeric value from a Currency expression.

MTON(mExpression)

Return Values

Numeric

Parameters

  • mExpression
    Specifies a Currency expression whose value MTON( ) returns. mExpression must evaluate to a valid Currency value or Visual FoxPro generates an error.

    Currency values are created by placing a dollar sign ($) prefix immediately before a Numeric value.

Remarks

MTON( ) returns a Numeric value with four decimal places.

Example

The following example creates a currency type variable named gyMoney. TYPE( ) displays Y, indicating the variable is a currency type. MTON( ) is used to convert the variable to a numeric type, and TYPE( ) now displays N, indicating the variable is a numeric type after the conversion.

STORE $24.95 TO gyMoney  && Creates a currency type memory variable
CLEAR
? "gyMoney is type: "  
?? TYPE('gyMoney')  && Displays Y, currency type value

gyMoney = MTON(gyMoney)     &&  Converts gyMoney to a numeric value
? "gyMoney is now type: "  
?? TYPE('gyMoney')  && Displays N, numeric type value

See Also

NTOM( ) | TYPE( ) Function