Skip to content

Commit 905eb4e

Browse files
author
Dave Conway-Jones
committed
fix numeric step rounding when changed by ui_control
1 parent 78f7dd4 commit 905eb4e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- Stop propagation of swipe when using color picker - Issue #539
1111
- Handle tab names with multiple spaces in for hide/show - Issue #541
1212
- Update gulpfile.js to gulp 4 - Issue #542
13+
- Fix numeric step rounding when changed by ui_control
1314

1415
### 2.17.1: Maintenance Release
1516

dist/dashboard.appcache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CACHE MANIFEST
2-
# Time: Wed Nov 13 2019 11:27:21 GMT+0000 (Greenwich Mean Time)
2+
# Time: Thu Nov 21 2019 22:07:04 GMT-0500 (Eastern Standard Time)
33

44
CACHE:
55
i18n.js

ui.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ var mani = {
6060
]
6161
}
6262

63-
function toNumber(keepDecimals, config, input) {
63+
function toNumber(keepDecimals, config, input, old, m, s) {
6464
if (input === undefined) { return; }
6565
if (typeof input !== "number") {
6666
var inputString = input.toString();
6767
input = keepDecimals ? parseFloat(inputString) : parseInt(inputString);
6868
}
69-
if (config.step) { input = Math.round(Math.round(input/config.step)*config.step*10000)/10000; }
69+
if (s) { input = Math.round(Math.round(input/s)*s*10000)/10000; }
7070
return isNaN(input) ? config.min : input;
7171
}
7272

@@ -172,7 +172,7 @@ function add(opt) {
172172

173173
// Call the convert function in the node to get the new value
174174
// as well as the full dataset.
175-
var conversion = opt.convert(msg.payload, oldValue, msg);
175+
var conversion = opt.convert(msg.payload, oldValue, msg, opt.control.step);
176176

177177
// If the update flag is set, emit the newPoint, and store the full dataset
178178
var fullDataset;

0 commit comments

Comments
 (0)