Skip to content

Commit

Permalink
change readout for 0 force, see phetsims/coulombs-law#77
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarlow12 committed Nov 5, 2018
1 parent 6356d85 commit a16e092
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/view/ISLCForceArrowNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ define( function( require ) {
updateLabel: function( forceValue, forceValues ) {

if ( forceValues ) {
var forceStr = Util.toFixed( forceValue, this.forceReadoutDecimalPlaces );
var forceStr = Util.toFixed( forceValue, forceValue === 0 ? 2 : this.forceReadoutDecimalPlaces );

// group values together so that they are easy to read
var pointLocation = forceStr.indexOf( '.' );
Expand All @@ -178,7 +178,7 @@ define( function( require ) {
formattedString += forceStr.substr( i, 3 );
}

if ( this.scientificNotationMode ) {
if ( this.scientificNotationMode && forceValue !== 0 ) {
var precision = 2;
var notationObject = ScientificNotationNode.toScientificNotation( forceValue, { mantissaDecimalPlaces: precision } );
formattedString = notationObject.mantissa;
Expand Down

0 comments on commit a16e092

Please sign in to comment.