Skip to content

Commit

Permalink
Fix error with print file weight
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfonsopl committed Nov 8, 2018
1 parent 08ef681 commit e606585
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion octoprint_astroprint/static/js/astroprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ $(function () {
self.layer_count = info.layer_count;
self.filament_length = Math.round(Number(info.filament_length / 10) * 100) / 100;
self.filament_volume = Math.round(Number(info.filament_volume / 1000) * 100) / 100;
self.filament_weight = Math.round(Number(info.filament_weight) * 100) / 100;
if(material){
self.filament_weight = Math.round((self.filament_volume * 0.001 * material.density) * 100) / 100;
}
self.total_filament = info.total_filament;
}

Expand Down

0 comments on commit e606585

Please sign in to comment.