Skip to Content
Menu
This question has been flagged
2 Replies
6715 Rodiniai

I want to replace the dot (.) with comma (,) and the comma with colon, that's it, a swap of the characters.


Is there any swap function in QWeb?

Portretas
Atmesti
Autorius

I meant to say:

I want to replace the dot (.) with comma (,) and the comma with dot, that's it, a swap of the characters.

I don't know why I cannot edit my own post...

Best Answer

use python string.replace in t-raw, watch for the order.

....

<t t-raw="'this string includes . , . , . '.replace(',',':').replace('.' , ',')" />

...

Portretas
Atmesti
Autorius

Thanks, but that's exactly what am I doing, with an extra intermediate replace. I want to know if there is a swap function to avoid the 3 calls to replace function.

nope. unless you add it yourself.

Related Posts Replies Rodiniai Veikla
0
spal. 23
3049
2
liep. 23
6489
1
birž. 23
4407
1
bal. 23
5135
1
lapkr. 22
3849