I am having issues with javascript and long decimals. The issue is that if you do effort driven, and fixed effort. If you have a long task with small effort you have a small decimal like 7.12334% for instance in the units of an assignment. I don't need that accuracy, so is there a way to truncate or set the number of decimals for units?
Support Forum
Hey jhughesoneplan,
You're looking for this https://bryntum.com/products/gantt/docs/api/Gantt/column/EffortColumn#config-decimalPrecision
Best regards,
Márcio
Hey jhughesoneplan,
Sorry, my mistake. If I understood correctly, you're trying to set the assignment unit to not have too many decimals, you can achieve that by using the following snippet (the minimum/maximum values are just for example, you can change as your wish)
features : {
taskEdit : {
items : {
resourcesTab : {
items : {
grid : {
columns : {
// Columns are held in a store, thus it uses `data`
// instead of `items`
data : {
units : {
format : {
minimumFractionDigits : 0,
maximumFractionDigits : 2
}
}
}
}
}
}
}
}
}
You can check the documentation here https://bryntum.com/products/gantt/docs/api/Core/widget/NumberField#config-format for more information.
If it's not what you're looking for, could you provide more context and maybe some screenshots of where you want to change?
Best regards,
Márcio
That would be effecting the task edit. I need the setting global. The issue is if you have a long duration task say 113 days and then say set the effort to 1 hour. Your units decimal is 0.11061946902654868. This causes an issue especially since javascript has issues handling large decimals. I want that truncated to 2 decimals in my case.