You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to apply a decimal rating i.e. 2.3 but it won't display the correct result. I'm using knockout.js.
Any ideas how to fix?
var rating = ko.observable(2.3);
var options = {
values: [1,2,3,4,5],
allowFractional: true,
calculateFractional: function (current, rate) {
if (current.indexOf(rate) === 1) {
return 0.6
};
return 1;
},
allowFractional: true,
readonly: true,
applyHoverCss: false
}
I did this which works but how would you apply decimals without my edit?
calculateFractional: function (current, rate) {
if (current - rate > 1) {
return 1;
} else {
var x = current - rate;
return 1 + x;
}
},
The text was updated successfully, but these errors were encountered:
I am trying to apply a decimal rating i.e. 2.3 but it won't display the correct result. I'm using knockout.js.
Any ideas how to fix?
var rating = ko.observable(2.3);
var options = {
values: [1,2,3,4,5],
allowFractional: true,
calculateFractional: function (current, rate) {
if (current.indexOf(rate) === 1) {
return 0.6
};
return 1;
},
allowFractional: true,
readonly: true,
applyHoverCss: false
}
I did this which works but how would you apply decimals without my edit?
calculateFractional: function (current, rate) {
if (current - rate > 1) {
return 1;
} else {
var x = current - rate;
return 1 + x;
}
},
The text was updated successfully, but these errors were encountered: