本文整理汇总了Golang中github.com/c-darwin/dcoin-go/packages/dcparser.Parser.CalcProfit_24946方法的典型用法代码示例。如果您正苦于以下问题:Golang Parser.CalcProfit_24946方法的具体用法?Golang Parser.CalcProfit_24946怎么用?Golang Parser.CalcProfit_24946使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/c-darwin/dcoin-go/packages/dcparser.Parser
的用法示例。
在下文中一共展示了Parser.CalcProfit_24946方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: main
//.........这里部分代码省略.........
{101: "user"},
{295: "miner"},
}
test_data[18].holidays_array = [][]int64{
{0, 10},
{10, 20},
{30, 30},
{40, 50},
{66, 99},
{233, 1999},
}
test_data[18].max_promised_amount_array = []map[int64]string{
{0: "1000"},
{63: "3333"},
{156: "899"},
{220: "500"},
}
test_data[18].currency_id = 10
test_data[18].result = 5157.6623487708
test_data[19] = new(calcProfitTest)
test_data[19].amount = 1500
test_data[19].repaid_amount = 0
test_data[19].time_start = 50
test_data[19].time_finish = 140
test_data[19].pct_array = []map[int64]map[string]float64{
{0: {"user": 0.0059, "miner": 0.05}},
{36: {"user": 0.0088, "miner": 0.08}},
{164: {"user": 0.0049, "miner": 0.04}},
{223: {"user": 0.0029, "miner": 0.02}},
}
test_data[19].points_status_array = []map[int64]string{
{0: "miner"},
{98: "miner"},
{101: "user"},
{295: "miner"},
}
test_data[19].holidays_array = [][]int64{
{0, 10},
{10, 20},
{30, 30},
{40, 50},
{66, 99},
{233, 1999},
}
test_data[19].max_promised_amount_array = []map[int64]string{
{0: "1000"},
{63: "3333"},
{156: "899"},
{220: "500"},
}
test_data[19].currency_id = 1
test_data[19].result = 129106.50065867
test_data[20] = new(calcProfitTest)
test_data[20].amount = 1500
test_data[20].repaid_amount = 50
test_data[20].time_start = 50
test_data[20].time_finish = 140
test_data[20].pct_array = []map[int64]map[string]float64{
{0: {"user": 0.0059, "miner": 0.05}},
{36: {"user": 0.0088, "miner": 0.08}},
{164: {"user": 0.0049, "miner": 0.04}},
{223: {"user": 0.0029, "miner": 0.02}},
}
test_data[20].points_status_array = []map[int64]string{
{0: "miner"},
{98: "miner"},
{101: "user"},
{295: "miner"},
}
test_data[20].holidays_array = [][]int64{
{0, 10},
{10, 20},
{30, 30},
{40, 50},
{66, 99},
{233, 1999},
}
test_data[20].max_promised_amount_array = []map[int64]string{
{0: "1000"},
{63: "1525"},
{64: "1550"},
{139: "500"},
}
test_data[20].currency_id = 10
test_data[20].result = 4966.7977985526
f, _ := os.OpenFile("dclog.txt", os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0777)
defer f.Close()
// log.SetOutput(io.MultiWriter(f, os.Stdout))
log.SetOutput(f)
log.SetFlags(log.LstdFlags | log.Lshortfile)
for i := 0; i < 21; i++ {
p := new(dcparser.Parser)
profit, _ := p.CalcProfit_24946(test_data[i].amount, test_data[i].time_start, test_data[i].time_finish, test_data[i].pct_array, test_data[i].points_status_array, test_data[i].holidays_array, test_data[i].max_promised_amount_array, test_data[i].currency_id, test_data[i].repaid_amount)
//fmt.Println(i, utils.Round(test_data[i].result, 8), utils.Round(profit, 8))
}
}