I haven't read far enough to know how this is used, but if it's being mathjax'd you might want to say `s += "^{" + degree + "}"` just in case `degree` is more than one character.