Skip to content

Commit 822ec25

Browse files
committed
build: Travis CI automatic compilation
1 parent dfcd6ba commit 822ec25

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

dist/counter/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/dist/counter/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ Component({
114114
} else if (type === 'reduce') {
115115
result = count - step < min ? min : count - step;
116116
}
117+
// 浮点数运算会有精确度问题,保留两位小数
118+
result = result.toFixed(2);
119+
result = parseFloat(result);
117120

118121
this.setData({ count: result });
119122
eventUtil.emit(this, 'lintap', {

0 commit comments

Comments
 (0)