NTOM( ) Function
Returns a Currency value with four decimal places from a numeric expression.
NTOM(nExpression)
Currency
- nExpression
Specifies a numeric expression whose Currency value NTOM( ) returns. If nExpression has more than four decimal places, it is rounded to four decimal places. If nExpression has less than four decimals places, it is padded with zeros until four decimal places are created.
The following example creates a numeric type variable named gnNumeric
. TYPE( ) displays N, indicating the variable is a numeric type. NTOM( ) is used to convert the variable to a currency type, and TYPE( ) now displays Y, indicating the variable is a currency type after the conversion.
STORE 24.95 TO gnNumeric && Creates a numeric type memory variable
CLEAR
? "gnNumeric is type: "
?? TYPE('gnNumeric') && Displays N, numeric type value
gnNumeric= NTOM(gnNumeric) && Converts gnNumeric to a currency value
? "gnNumeric is now type: "
?? TYPE('gnNumeric') && Displays Y, currency type value