Skip to content

Commit

Permalink
verify at most 1 decimal place in amplitudes, #144
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelzoom committed Aug 17, 2021
1 parent 939dff0 commit 0d28b09
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion game-setup-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@
const amplitude = harmonics[ i ].amplitude;
assert && assert( amplitude !== undefined, `harmonic ${order} is missing the amplitude field` );
assert && assert( amplitude >= -MAX_AMPLITUDE && amplitude <= MAX_AMPLITUDE, `harmonic ${order} amplitude is out of range: ${amplitude}` );
//TODO verify that amplitude has at most 1 decimal place
assert && assert( ( amplitude.toFixed( 0 ) === '' + amplitude ) || ( amplitude.toFixed( 1 ) === '' + amplitude ),
`harmonic ${order} amplitude has more than 1 decimal place: ${amplitude}` );
const amplitudePropertyID = `fourierMakingWaves.waveGameScreen.model.level${level}.answerSeries.harmonics.harmonic${order}.amplitudeProperty`;
phetioClient.invoke( amplitudePropertyID, 'setValue', [ amplitude ] );
}
Expand Down

0 comments on commit 0d28b09

Please sign in to comment.