İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
6644 Görünümler

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
Vazgeç
Üretici

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

En İyi Yanıt

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

....

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

...

Avatar
Vazgeç
Üretici

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.

İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Eki 23
3006
2
Tem 23
6318
1
Haz 23
4330
1
Nis 23
5047
1
Kas 22
3760