实现效果
字符型转为数值型
destring Stkcd,replace
数值型转为字符型
tostring Stkcd,replace replace Stkcd=substr("000000",1,6-length(Stkcd))+Stkcd
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/232725.html原文链接:https://javaforall.net
Stata字符型与数值型数据的转换——上市公司证券代码字符型与数值型的互换实现效果假设 000001 000012 000123 002345 为某些上市公司证券代码 上市公司实证研究中 常常需要用到上市公司证券代码 将字符型转为数值型比较容易 直接用 destring 命令即可实现 但是数值型转为字符型并且补齐 6 位数的命令比较少见 字符型转为数值型 destringStkc replace 数值型转为字符型 tostringStkc
destring Stkcd,replace
tostring Stkcd,replace replace Stkcd=substr("000000",1,6-length(Stkcd))+Stkcd
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/232725.html原文链接:https://javaforall.net