Mathematically your question has no solution. You can use round function to convert a number to 2 decimals. But how do you "convert" a number into percentage? Unless values of drive.current.max represents a ratio, this makes no sense. Percentage compared with what?
Thank you very much for your reply. In fact, the returned result is indeed a percentage, and the returned data comes from Siemens PLC. '2398' is actually 23.98%, so I want to convert the result to 2 decimal places and add a percentage sign to the converted decimal.
OK, so it's not about "converting" as much as simply dividing by 100. When you divide by 100 you can use round() to strip the decimal part.
And if you want to display it as a string ending with a percent sign, use fieldformat so that the underlying value doesn't get rendered into a string (that would break reasonable sorting). You might even leave the original data as is and only divide within fieldformat.
Like this:
| fieldformat whatever=tostring(whatever/100)."%"
One caveat in your case might be that you're using timechart to prepare your data and your field name(s) will vary depending on your input data and I'm not 100% sure that fieldformat will work with foreach.