Adding ultrasonic distance TX

I need help adding the ultrasonic distance to my Radio.send package. I want to send voltage and distance in the package. I only receive the voltage and not the distance

This is my ultrasonic code.
case ReadVoltage:
{

    //Voltage
    pinMode(VBAT_ADC_CTL, OUTPUT);
    digitalWrite(VBAT_ADC_CTL, LOW);
    voltage = analogRead(ADC) * 2;
    pinMode(VBAT_ADC_CTL, INPUT);

    //Ultrasonic
    // Clears the trigPin
    digitalWrite(trigPin, LOW);
    delayMicroseconds(2);
    // Sets the trigPin on HIGH state for 10 micro seconds
    digitalWrite(trigPin, HIGH);
    delayMicroseconds(10);
    digitalWrite(trigPin, LOW);
    // Reads the echoPin,
    duration = pulseIn(echoPin, HIGH);
    // Calculating the distance
    float distance = duration * 0.034 / 2;
    Serial.println(distance);

    state = TX;
    break;

This is my Radio.send:
case TX:
{
sprintf(txPacket,"%s",“battery_distance: “);
sprintf(txPacket+strlen(txPacket),”%d”,voltage);
sprintf(txPacket+strlen(txPacket),"%2.2g",distance);
turnOnRGB(COLOR_SEND,0);
Serial.printf("\r\nsending packet “%s” , length %d\r\n",txPacket, strlen(txPacket));
Radio.Send( (uint8_t *)txPacket, strlen(txPacket) );
state=LOWPOWER;
break;
}

Did you see any serial output if the sensor measure correctly?

I can’t seem to send the voltage and distance in the same package.

This is on my cubecell side;
17:32:29.888 -> sending packet “ADC_battery: 4494” , length 17
17:32:32.034 -> TX done!

this is on my Heltec WiFi LoRa 32 V2;
17:34:57.974 -> Message ID: 65
17:34:58.021 -> Message length: 68
17:34:58.021 -> Message: C_battery: 4535
17:34:58.021 -> RSSI: -57
17:34:58.021 -> Snr: 10.25

Perhaps you should check it separately if you calculate the distance by making serial print of the variable. And when check your array that you want to send and also check in your code that I can’t see if you have declared right how many bytes you want to send.