Skip to content

Commit 19bcb4b

Browse files
committed
Do not try to cast as number when decimals option is not defined
1 parent ff7298b commit 19bcb4b

File tree

7 files changed

+433
-433
lines changed

7 files changed

+433
-433
lines changed

build/MathBox-bundle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -46876,7 +46876,7 @@ MathBox.Renderable.Labels.prototype = _.extend(new MathBox.Renderable(null), {
4687646876
if (text === undefined) text = '';
4687746877

4687846878
// Try to cast to number and round to n decimals
46879-
if (+text == text) {
46879+
if (decimals !== undefined && +text == text) {
4688046880
var x = +text;
4688146881
if (x != 0) {
4688246882
var s = x < 0 ? -1 : 1;

build/MathBox-bundle.min.js

+359-359
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/MathBox-core.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4186,7 +4186,7 @@ MathBox.Renderable.Labels.prototype = _.extend(new MathBox.Renderable(null), {
41864186
if (text === undefined) text = '';
41874187

41884188
// Try to cast to number and round to n decimals
4189-
if (+text == text) {
4189+
if (decimals !== undefined && +text == text) {
41904190
var x = +text;
41914191
if (x != 0) {
41924192
var s = x < 0 ? -1 : 1;

build/MathBox-core.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/MathBox.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -7248,7 +7248,7 @@ MathBox.Renderable.Labels.prototype = _.extend(new MathBox.Renderable(null), {
72487248
if (text === undefined) text = '';
72497249

72507250
// Try to cast to number and round to n decimals
7251-
if (+text == text) {
7251+
if (decimals !== undefined && +text == text) {
72527252
var x = +text;
72537253
if (x != 0) {
72547254
var s = x < 0 ? -1 : 1;

0 commit comments

Comments
 (0)