Skip to content

Commit

Permalink
Util.roundSymmetric for Math.round, #298
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Sep 22, 2017
1 parent f5e5d66 commit df9476c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions js/flow/model/FlowModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ define( function( require ) {
var Sensor = require( 'FLUID_PRESSURE_AND_FLOW/common/model/Sensor' );
var StringUtils = require( 'PHETCOMMON/util/StringUtils' );
var Units = require( 'FLUID_PRESSURE_AND_FLOW/common/model/Units' );
var Util = require( 'DOT/Util' );
var Vector2 = require( 'DOT/Vector2' );
var VelocitySensor = require( 'FLUID_PRESSURE_AND_FLOW/common/model/VelocitySensor' );

Expand Down Expand Up @@ -258,7 +259,7 @@ define( function( require ) {
(Units.FLUID_DENSITY_ENGLISH_PER_METRIC * this.fluidDensityProperty.value).toFixed( 2 ), densityUnitsEnglishString );
}
else {
return StringUtils.format( valueWithUnitsPatternString, Math.round( this.fluidDensityProperty.value ), densityUnitsMetricString );
return StringUtils.format( valueWithUnitsPatternString, Util.roundSymmetric( this.fluidDensityProperty.value ), densityUnitsMetricString );
}
},

Expand All @@ -273,7 +274,7 @@ define( function( require ) {
(Units.FLUID_FlOW_RATE_ENGLISH_PER_METRIC * this.pipe.flowRateProperty.value).toFixed( 2 ), rateUnitsEnglishString );
}
else {
return StringUtils.format( valueWithUnitsPatternString, Math.round( this.pipe.flowRateProperty.value ), rateUnitsMetricString );
return StringUtils.format( valueWithUnitsPatternString, Util.roundSymmetric( this.pipe.flowRateProperty.value ), rateUnitsMetricString );
}
},

Expand Down
2 changes: 1 addition & 1 deletion js/watertower/model/WaterTowerModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ define( function( require ) {
(Units.FLUID_DENSITY_ENGLISH_PER_METRIC * this.fluidDensityProperty.value).toFixed( 2 ), densityUnitsEnglishString );
}
else {
return StringUtils.format( valueWithUnitsPatternString, Math.round( this.fluidDensityProperty.value ), densityUnitsMetricString );
return StringUtils.format( valueWithUnitsPatternString, Util.roundSymmetric( this.fluidDensityProperty.value ), densityUnitsMetricString );
}
},

Expand Down

0 comments on commit df9476c

Please sign in to comment.