Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
6646 Tampilan

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
Buang
Penulis

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

Jawaban Terbai

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

....

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

...

Avatar
Buang
Penulis

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.

Post Terkait Replies Tampilan Aktivitas
0
Okt 23
3010
2
Jul 23
6322
1
Jun 23
4330
1
Apr 23
5049
1
Nov 22
3762