Skip to content

Commit

Permalink
Switch to Number(), see: phetsims/perennial#275
Browse files Browse the repository at this point in the history
  • Loading branch information
marlitas committed Jun 14, 2022
1 parent 77b17fc commit 29f79fc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions js/divide/model/DivideModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class DivideModel extends ArithmeticModel {
fillEquation: () => {

// Convert any strings entered by the user into numerical values.
this.problemModel.multiplierProperty.set( parseInt( this.problemModel.multiplierProperty.get(), 10 ) );
this.problemModel.multiplicandProperty.set( parseInt( this.problemModel.multiplicandProperty.get(), 10 ) );
this.problemModel.multiplierProperty.set( Number( this.problemModel.multiplierProperty.get() ) );
this.problemModel.multiplicandProperty.set( Number( this.problemModel.multiplicandProperty.get() ) );

// Submit this answer so that it can be checked.
this.submitAnswer();
Expand Down
4 changes: 2 additions & 2 deletions js/divide/view/DivideEquationNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ class DivideEquationNode extends EquationNode {
// If the input value changes, it means that the user entered something, so put it in the appropriate equation node.
inputProperty.lazyLink( inputString => {
if ( activeInputProperty.get() === 'multiplicand' ) {
multiplicandProperty.set( parseInt( inputString, 10 ) );
multiplicandProperty.set( Number( inputString ) );
}
else if ( activeInputProperty.get() === 'multiplier' ) {
multiplierProperty.set( parseInt( inputString, 10 ) );
multiplierProperty.set( Number( inputString ) );
}
} );

Expand Down
2 changes: 1 addition & 1 deletion js/multiply/model/MultiplyModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class MultiplyModel extends ArithmeticModel {

super( tandem, {
fillEquation: () => {
this.problemModel.productProperty.set( parseInt( this.inputProperty.get(), 10 ) );
this.problemModel.productProperty.set( Number( this.inputProperty.get() ) );
this.submitAnswer();
}
} );
Expand Down

0 comments on commit 29f79fc

Please sign in to comment.