'value'는 5이고 'maxValue'는 39입니다. 진행률 막대 (wijmo progressbar)에 표시된 값은 5.07입니다. {0}은 백분율이 아닌 진행률 값을 표시하도록 진행률 표시 줄에 알려야합니다. 값을 8로 변경하고 최대 값을 39로 유지하면 표시되는 값은 8.19가됩니다. 나는 부동 소수점 숫자가 아닌 정수가 왜 보이는지 혼란 스럽다. progressbar 코드에서 콘솔에 정수로 기록하는 self.value() 이외의 다른 내용은 표시되지 않습니다. 그래서이 행동의 원인은 무엇입니까?진행률 막대에 부동 소수점 값이 표시되는 이유는 무엇입니까?
$("#proBarAdherence").wijprogressbar({
value: Gymloop.completedCount,
animationOptions: {
duration: 1000
},
maxValue: Gymloop.targetSessions,
indicatorImage: '/images/progbar_red.png',
labelAlign: 'running',
labelFormatString: '{0} sessions completed',
beforeProgressChanging: function(e,data) {
console.log('beforeprogresschanging',data);
},
progressChanging: function (e,data) {
console.log('progresschanging',data);
},
progressChanged : function (e,data) {
console.log('progresschanged',data);
}
});
beforeprogresschanging Object { oldValue="5", newValue=5}
progresschanging Object { oldValue="5", newValue=0}
progresschanging Object { oldValue="0", newValue=1.17}
progresschanging Object { oldValue="1.17", newValue=1.56}
progresschanging Object { oldValue="1.56", newValue=1.95}
progresschanging Object { oldValue="1.95", newValue=2.34}
progresschanging Object { oldValue="2.34", newValue=2.73}
progresschanging Object { oldValue="2.73", newValue=3.12}
progresschanging Object { oldValue="3.12", newValue=3.51}
progresschanging Object { oldValue="3.51", newValue=3.9}
progresschanging Object { oldValue="3.9", newValue=4.29}
progresschanging Object { oldValue="4.29", newValue=4.68}
progresschanging Object { oldValue="4.68", newValue=5.07}
progresschanged Object { oldValue="5", newValue=5}
업데이트
내가 progressChanging 이벤트 동안 값의 참조하지만, 애니메이션이 완료되면 라벨 표시 (5) 대신에 5.07을하는 방법을 잘 모르겠습니다 수 있습니까? 라이브 예제가 있습니다 here
은 내가 이미 시도 언급해야합니다. 차이는 없습니다. 코드를 업데이트했습니다. – codecowboy
http://wijmo.com/wiki/index.php/Progressbar#Events – Prospero
다른 업데이트를했습니다. 부동 소수점 숫자는 어디에서 왔는지 알 수 있지만 변경 방법을 모르겠습니다. 내 완료 카운트 변수가 변경되지 않아서 무슨 뜻인지 잘 모르겠습니다. completedCount = round (newValue) – codecowboy