MZ Result of change being not a number

I've been making some changes to the base shop status window. Everything is great except I want the result of change to -- instead of 0, when there is no change in that stat between items.

I'm basically using the same code as the base windo code for it and it uses ( I'm not at my computer so please bear with me)

const change = this._item.params[paramId] - (item1 ? item1.params[paramId] : 0);

Obviously it's a little more than "item param" but it gets my point until I can update it with the code.

I'm just not sure how to get the 0 to show up as --. Would I need to do via a separate function? Or another way?

Thanks in advance.
const change =
Item param - item param : 0;
This is incorrect syntax. It looks like you're trying to do a ternary operator, but you're missing, like, half of it.


So more correctly you would do something like (pseudo-ish code, as you had above):
Code:
const change = new param - existing param != 0 ? new param - existing param : "--" :
The default code for the shop status window looks like...
Code:
Window_ShopStatus.prototype.drawActorParamChange = function(
    x, y, actor, item1
) {
    const width = this.innerWidth - this.itemPadding() - x;
    const paramId = this.paramId();
    const change =
        this._item.params[paramId] - (item1 ? item1.params[paramId] : 0);
    this.changeTextColor(ColorManager.paramchangeTextColor(change));
    this.drawText((change > 0 ? "+" : "") + change, x, y, width, "right");
};
...so. What you want might look something like...
Code:
Window_ShopStatus.prototype.drawActorParamChange = function(
    x, y, actor, item1
) {
    const width = this.innerWidth - this.itemPadding() - x;
    const paramId = this.paramId();
    const change =
        this._item.params[paramId] - (item1 ? item1.params[paramId] : 0);
    this.changeTextColor(ColorManager.paramchangeTextColor(change));
    if (change > 0) {
        this.drawText("+" + change, x, y, width, "right");
    } else if (change < 0) {
        this.drawText(change, x, y, width, "right");
    } else {
        this.drawText("--", x, y, width, "right");
    };
};
...this?

*Edit: Though, now that it's been pointed out, yeah, setting the value of the variable "change" to be a string that contains "--" when the number would otherwise be 0 should work.
Thanks so much for the replies. It really helped me out.

EDIT:
This is what I essentially did:
this.drawText((change > 0 ? "+" : "") + (change > 0 ? change : "") + (change < 0 ? change : "") + (change === 0 ? "--" : ""), x, y, width, "right");

Original thread: https://forums.rpgmakerweb.com/threads/result-of-change-being-not-a-number.157049/