Convert integer to string, split at the decimal and then include the decimal in the 2nd part of the array?

I would like to split a number at the decimal in order to convert the number after the decimal into a fraction.

var num = 2.2287,
    numString = num.toString(),
    numSplit = numString.split('.'),
    decimal = parseInt(numSplit[1]);

$('.number').text(decimal);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="number"></div>

This gets me 2287, how would I go about adding the decimal back into the 2nd part of the array so that I would get .2287

Answer

Alternatively, you can use substring to get the decimal and everything that follows.

var num = 2.2287,
    numString = num.toString(),
    decimal = parseFloat(numString.substring(numString.indexOf('.')))