Skip to content

Commit bccec80

Browse files
author
7yue
committed
Merge branch 'develop' of github.com:TaleLin/lin-ui into develop
2 parents 336ded7 + 822ec25 commit bccec80

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)