sendTelgram how to format a item with unit

I want to send a text message + the battery value of a item and can’t get it working.

rule "Bewaking deurbel" 
   Item ShellyDeurbelLowBattery changed to ON  or Item testSwitch changed
    val telegramAction = getActions("telegram","telegram:telegramBot:BotHennie")
    var String BatValue = ShellyDeurbelBatteryLevel.state.toString
    logInfo("default.rules", "Bewaking deurbel : " + BatValue) 
    telegramAction.sendTelegram("Batterij deurbel laag " + BatValue)
The logline shows "Bewaking deurbel : 80 %" as expected but the last line gives a error
"Script execution of rule with UID 'OH3BatterijBewaking-2' failed: Conversion = '%' in OH3BatterijBewaking"

I believe your % will need escaping as %% in this usage.

A safe way to do that would be a string replace % with %%.

added line below and working fine.

    BatValue=BatValue.replace ("%","%%")

Or even easier

telegramAction.sendTelegram("Batterij deurbel laag " + ShellyDeurbelBatteryLevel.state.toString.replace ("%","%%"))