Skip to content

Commit

Permalink
Changed from Math.round to DOT.Util.roundSymmetric where needed, see p…
Browse files Browse the repository at this point in the history
…hetsims/tasks#275.  Did some other minor cleanup in the process.
  • Loading branch information
jbphet committed Jun 22, 2015
1 parent c6a7212 commit c848c40
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/common/view/CompositeThermometerNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ define( function( require ) {
var ThermometerNode = require( 'SCENERY_PHET/ThermometerNode' );
var Text = require( 'SCENERY/nodes/Text' );
var StatesOfMatterConstants = require( 'STATES_OF_MATTER/common/StatesOfMatterConstants' );
var Util = require( 'DOT/Util' );

// strings
var kelvinUnits = require( 'string!STATES_OF_MATTER/kelvinUnits' );
Expand Down Expand Up @@ -66,7 +67,7 @@ define( function( require ) {
var tempInKelvin = multipleParticleModel.getTemperatureInKelvin();
var tempInKelvinRounded = Math.round( multipleParticleModel.getTemperatureInKelvin() );
temperatureKelvinText.setText( tempInKelvinRounded + " " + kelvinUnits );
temperatureCelsiusText.setText( Math.round( tempInKelvin - 273.15 ) + " " + celsiusUnits );
temperatureCelsiusText.setText( Util.roundSymmetric( tempInKelvin - 273.15 ) + " " + celsiusUnits );
temperatureInKelvinProperty.value = tempInKelvinRounded > MAX_TEMPERATURE_TO_CLAMP_RED_MERCURY ?
MAX_TEMPERATURE_TO_CLAMP_RED_MERCURY : tempInKelvinRounded;
} );
Expand Down

0 comments on commit c848c40

Please sign in to comment.