Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
2 Besvarelser
6652 Visninger

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
Kassér
Forfatter

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

Bedste svar

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

....

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

...

Avatar
Kassér
Forfatter

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 Besvarelser Visninger Aktivitet
0
okt. 23
3014
2
jul. 23
6325
1
jun. 23
4332
1
apr. 23
5049
1
nov. 22
3762