Mixed langauge input lead to change the order of the input text

Hello
As a developer in the middle east, I am building a game on Android and IOS that support English and Arabic Language.
And I have a problem when the player enters an Arabic text with English numbers with arithmetic operation where the equation he/she wrote will have a different order than the one he/she entered in the input field.

for example: if
if the player enter: ما ناتج 5 * 8 + 6
It will be shown as: ما ناتج 5 + 6 * 8
The words “ما ناتج” means what is the result of

And to handle Arabic letters, I am using RTL Text Mesh Pro

So is there any solution for this problem?