我开始评估qDecimal库,但我遇到了一个令人困惑的问题:
story.chapterUrls.reduce(async function(promise, chapterUrl) {
const chapter = await getJSON(chapterUrl);
await promise;
addHtmlToPage(chapter.html);
}, Promise.resolve());
输出:
QDEBUG:UtilsTests :: test()“9.340000000000000”
我做错了什么?
答案 0 :(得分:2)
我无法通过快速搜索QDecDouble找到任何东西......但我几乎可以肯定
val=val.add(QDecDouble(0.01));
会有所作为。你做的方式,结果没有保存在某个地方......
通常这些命令会返回您想要的结果,您必须将其保存在某个地方......