我正在使用一个返回值的
Node.js模块
,我需要将其转换为字符串或64位整数
。
返回的值看起来像这样:{ low: 214107458, high: 17825793, unsigned: true }
文档说明它是一种叫做十进制字符串
的东西。我不确定这是什么意思。
我想要的值应该长这样:76561198174373186
我该如何转换呢?
这是我从中获取值的模块:
https://github.com/seishun/node-steam
具体来说,是这段代码:
https://github.com/seishun/node-steam/blob/84cc4f870b8da4755ba057acff336a093891458f/lib/handlers/friends/index.js
这是我需要发送转换值的模块:https://github.com/Lwatt/node-steam-userinfo/blob/master/index.js
我的代码:steamFriends.on('friendMsg', function(steamID, message, type) {
if(type != Steam.EChatEntryType.ChatMsg) return;
steamuserinfo.getUserInfo(steamID, function(error, data){
if(error) throw error;
var datadec = JSON.parse(JSON.stringify(data.response)); //This returns an empty array because steamID is in incorrect form.
console.log(steamID); //Output: { low: 214107458, high: 17825793, unsigned: true }
});
});