ntom( ) 函数示例

下面示例创建了一个数值型内存变量 gnnumeric。type( ) 函数显示 n ,标明该内存变量为数值型。之后ntom( ) 函数将其转换为货币型,type( ) 函数显示 y ,标明该内存变量在转换后变为货币型。

store 24.95 to gnnumeric && 创建一个数值型内存变量
clear
? "gnnumeric is type: " 
?? type('gnnumeric') && 显示 n,数值型值

gnnumeric= ntom(gnnumeric) && 将 gnnumeric 转换成货币型
? "gnnumeric is now type: " 
?? type('gnnumeric') && 显示 y,货币型值