Konstantin
Top achievements
Rank 1
Konstantin
asked on 20 Sep 2018, 08:54 AM
Hi,ProgressBar with type="percent" round 99.99 to 100%, need math.floor to 99% or 99.99%
https://dojo.telerik.com/OqeqAkOV/2
3 Answers, 1 is accepted
0
Hi Konstantin,
You can use Math.floor if you need to, e.g.,:
however by default the ProgressBar does not display decimal numbers when its type is set to "percent". With this type set if you try to pass a decimal number as value it will be rounded up or down depending on the value: e.g., 99.4 is rounded down and displayed 99%, while 99,5 is rounded up and displayed 100%.
You can log the ability to display fractional percent as a feature request in our Feedback Portal. It will be evaluated by the team and if approved will be implemented in a subsequent release.
Regards,
Ivan Danchev
Progress Telerik
You can use Math.floor if you need to, e.g.,:
$(
'#PercentValue'
).kendoProgressBar({
value: Math.floor(model.CompletionPercent),
type:
'percent'
,
min: 0,
max: 100,
animation:
false
});
You can log the ability to display fractional percent as a feature request in our Feedback Portal. It will be evaluated by the team and if approved will be implemented in a subsequent release.
Regards,
Ivan Danchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Konstantin
Top achievements
Rank 1
answered on 24 Sep 2018, 03:46 AM
Hello, Ivan.
It's not complite solution. It's help only for grid. I'm use EditorTemplates for edit:
@(Html.Kendo().ProgressBar()
.Name(ViewData.TemplateInfo.GetFullHtmlFieldName(""))
.Type(ProgressBarType.Percent)
.HtmlAttributes(new { style = "width:100%", data_bind="value:" + ViewData.TemplateInfo.GetFullHtmlFieldName("") }))
0
Hello Konstantin,
Indeed the suggested workaround would not be applicable to all scenarios. That is why I suggest logging a feature request. Implementing it would allow fractional percent to be properly used by the widget.
Regards,
Ivan Danchev
Progress Telerik
Indeed the suggested workaround would not be applicable to all scenarios. That is why I suggest logging a feature request. Implementing it would allow fractional percent to be properly used by the widget.
Regards,
Ivan Danchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.