Hi!
The issue is that you are attaching the dollar sign directly to the numeric value, and the second expression is trying to do math on something that contains a non-numeric character.
Two ways to handle this:
- Put the dollar sign in a separate text widget to the left of the number you create (without the dollar sign)
- Use an expression to strip out the dollar sign before trying to subtract from it.
I’d recommend the former just in the spirit of keeping things simple, but the latter goes like this:
[[LVAR_ChampionPrice.replace('$', '') - (1 + 49 * Math.random()).toFixed(0) ]]
The replace() function replaces the its first parameter in the string with its second parameter: here, a dollar sign with nothing.
IMPORTANT: Since this expression involves quotes, make sure you aren’t using “smart quotes.” When you look closely at the single quotes or double quotes, they should be straight up-and-down instead of hooked. If you’re using MacOs, turn off smart quotes in the system preferences under Keyboard > Text.