JSFiddle - React, Tailwind, and code Playground

HTML

<div id="resultado"></div>

JavaScript

var x = '2,5';
var partes = x.split(',');
var htmlString = partes[0] + '<sup>' + partes[1] + '</sup>';
document.getElementById('resultado').innerHTML = htmlString;