Fastest way to get integer mod 10 and integer divide 10?
Heres a binary to BCD algorithm I used several years ago based on one found here.  I was using an external BCD to 7 seg display driver so the result could be written to the proper ports directly as packed BCD for output.
This is fairly fast if you have a hardware multiplier in the PIC, I was using a PIC18F97J60.  If you don't have a hardware multiplier on your PIC, consider using shift + add for the multiplication.
This takes in an unsigned 16-bit int and returns packed BCD with 5 digits, it could be modified and made faster for 4 digits.  It uses shift + additions to approximate division by 10 but given the limited input range it is exact for this use.  You may want to pack the result differently as well to line up with how your using the result.
void intToPackedBCD( uint16_t n, uint8_t *digits ) {
    
    uint8_t d4, d3, d2, d1, d0, q;  //d4 MSD, d0 LSD

    d1 = (n&gt;&gt;4)  &amp; 0xF;
    d2 = (n&gt;&gt;8)  &amp; 0xF;
    d3 = (n&gt;&gt;12) &amp; 0xF;

    d0 = 6*(d3 + d2 + d1) + (n &amp; 0xF);
    q = (d0 * 0xCD) &gt;&gt; 11;
    d0 = d0 - 10*q;

    d1 = q + 9*d3 + 5*d2 + d1;
    q = (d1 * 0xCD) &gt;&gt; 11;
    d1 = d1 - 10*q;

    d2 = q + 2*d2;
    q = (d2 * 0x1A) &gt;&gt; 8;
    d2 = d2 - 10*q;

    d3 = q + 4*d3;
    d4 = (d3 * 0x1A) &gt;&gt; 8;
    d3 = d3 - 10*d4;

    digits[0] = (d4&lt;&lt;4) | (d3);
    digits[1] = (d2&lt;&lt;4) | (d1);
    digits[2] = (d0&lt;&lt;4);
}