JSFiddle - React, Tailwind, and code Playground
JavaScript
function typeOfNumber(x) {
if( x >= 1 ) {
if(x % 1 == 0) {
return ("N " + "и" + " Z" + " и" + " R");
}
}
if (x % 1 == 0) {
return ("Z " + "и" + " R");
}
if (x.toFixed(0) != x) {
return ("Q " + "и" + " R");
}
return ("T " + "и" + " R");
}