Commit 09a68af9 by zihan

处理浮点数运算

parent b2fee23b
......@@ -10,7 +10,6 @@ const constants = require('./constants');
const {IPs, mergeDepth} = require('./util');
let totalOrderbook = {};
//todo 这里还要处理浮点数运算的问题
let getUpdatedData = function (currentData, response) {
const updateData = [];
......@@ -37,7 +36,7 @@ let getUpdatedData = function (currentData, response) {
updateData.push([response.data.price, response.data.count]);
} else {
// updateData = [[response.data.price, newCount]];
updateData.push([response.data.price, newCount]);
updateData.push([response.data.price, newCount.toPrecision(12)]);
}
return updateData;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment