mirror of
https://github.com/EDCD/coriolis.git
synced 2025-12-09 14:45:35 +00:00
Handle rounding erros on priority bands
This commit is contained in:
@@ -162,7 +162,8 @@ angular.module('app').directive('powerBands', ['$window', '$translate', '$rootSc
|
||||
}
|
||||
|
||||
function getClass(selected, sum, avail) {
|
||||
return selected ? 'secondary' : (sum >= avail) ? 'warning' : 'primary';
|
||||
// Round to avoid floating point precision errors
|
||||
return selected ? 'secondary' : ((Math.round(sum * 100) / 100) >= avail) ? 'warning' : 'primary';
|
||||
}
|
||||
|
||||
function bandText(val, index) {
|
||||
|
||||
Reference in New Issue
Block a user