TrustyFund/vuex-bitshares

Ошибка функции distributionSampling

roma219 opened this issue · 1 comments

Входные данные:
"{"1.3.0":0.041752022378637677,"1.3.113":0.01602069672965233,"1.3.121":0.01344197025218538,"1.3.850":0,"1.3.858":0.001780940442008715,"1.3.859":0.0018353858660724721,"1.3.861":0.6757403812150591,"1.3.943":0.017905748174603265,"1.3.973":0,"1.3.1042":0.0036329810811487014,"1.3.1093":0,"1.3.1362":0.011182597181160986,"1.3.1578":0.003648291522757851,"1.3.1893":0,"1.3.1999":0.2060768263022931,"1.3.2001":0.0016778003451197595,"1.3.2379":5.227955671417011e-7,"1.3.2935":0.0005413174672347214,"1.3.3128":0.0000011202762153036453,"1.3.3368":0,"1.3.3547":0.004761397970283553}"

Возвращает:
"{"1.3.943":0.01,"1.3.1999":0.2,"1.3.113":0.01,"1.3.861":0.67,"1.3.3547":0,"1.3.1578":0,"1.3.1042":0,"1.3.121":0.01,"1.3.859":0,"1.3.858":0,"1.3.0":0.04,"1.3.2379":null,"1.3.2001":0,"1.3.1362":0.01,"1.3.2935":0,"1.3.3128":0,"1.3.1893":0,"1.3.973":0,"1.3.850":0,"1.3.3368":0,"1.3.1093":0}"

Результат после исправления:
{
'1.3.943': 0.02,
'1.3.1999': 0.21,
'1.3.113': 0.02,
'1.3.861': 0.68,
'1.3.3547': 0.01,
'1.3.1578': 0,
'1.3.1042': 0,
'1.3.121': 0.01,
'1.3.859': 0,
'1.3.858': 0,
'1.3.0': 0.04,
'1.3.2001': 0,
'1.3.1362': 0.01,
'1.3.2935': 0,
'1.3.3128': 0,
'1.3.2379': 0,
'1.3.973': 0,
'1.3.1893': 0,
'1.3.850': 0,
'1.3.3368': 0,
'1.3.1093': 0
}