Skip to content

Commit

Permalink
Morecast: Respect precision when setting forecast values (bcgov#3659)
Browse files Browse the repository at this point in the history
  • Loading branch information
dgboss authored May 22, 2024
1 parent 351722d commit a36dcef
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ export class GridComponentRenderer {
// Check if the user has edited the value. If so, update the value and choice to reflect the Manual edit.
if (newValue.toFixed(precision) !== Number(params.row[field].value).toFixed(precision)) {
params.row[field].choice = ModelChoice.MANUAL
params.row[field].value = newValue
const fixedValue = newValue.toFixed(precision)

params.row[field].value = precision === 0 ? parseInt(fixedValue) : parseFloat(fixedValue)
}

return cloneDeep(params.row)
Expand Down

0 comments on commit a36dcef

Please sign in to comment.