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 7468cc5 commit 47d6d3f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/ohms-law/model/OhmsLawModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ define( function( require ) {
var PropertySet = require( 'AXON/PropertySet' );
var inherit = require( 'PHET_CORE/inherit' );
var Sound = require( 'VIBE/Sound' );
var Util = require( 'DOT/Util' );

// audio
var addBatteryAudio = require( 'audio!OHMS_LAW/add-battery' );
Expand Down Expand Up @@ -52,13 +53,13 @@ define( function( require ) {
//@override voltage.set (accuracy 0.1)
var oldVS = this.voltageProperty.set.bind( this.voltageProperty );
this.voltageProperty.set = function( val ) {
oldVS( Math.round( val * 10 ) / 10 );
oldVS( Util.roundSymmetric( val * 10 ) / 10 );
};

//@override resistance.set (accuracy 0)
var oldRS = this.resistanceProperty.set.bind( this.resistanceProperty );
this.resistanceProperty.set = function( val ) {
oldRS( Math.round( val ) );
oldRS( Util.roundSymmetric( val ) );
};
this.reset();
}
Expand Down

0 comments on commit 47d6d3f

Please sign in to comment.