Skip to Content
Menú
This question has been flagged
2 Respostes
6653 Vistes

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?

Avatar
Descartar
Autor

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('.' , ',')" />

...

Avatar
Descartar
Autor

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 Respostes Vistes Activitat
0
d’oct. 23
3014
2
de jul. 23
6327
1
de juny 23
4334
1
d’abr. 23
5051
1
de nov. 22
3763