Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
2 Antworten
6670 Ansichten

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
Verwerfen
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...

Beste Antwort

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

....

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

...

Avatar
Verwerfen
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.

Verknüpfte Beiträge Antworten Ansichten Aktivität
0
Okt. 23
3018
2
Juli 23
6345
1
Juni 23
4345
1
Apr. 23
5063
1
Nov. 22
3772