Skip to content

Commit

Permalink
paintAxis -- if number can be presented as an int print as int (e.g. …
Browse files Browse the repository at this point in the history
…1.0 => 1)
  • Loading branch information
jrobinso committed Oct 30, 2024
1 parent 1e5a2f1 commit 9fd9152
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/util/paintAxis.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function paintAxis(ctx, width, height, colorOrUndefined) {

if (number === 0) {
return "0"
} else if (Number.isInteger()) {
} else if (number % 1 === 0) { // Number can be represented exactly as an integer
return number
} else if (Math.abs(number) >= 10) {
return number.toFixed()
Expand Down

0 comments on commit 9fd9152

Please sign in to comment.