تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
6672 أدوات العرض

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?

الصورة الرمزية
إهمال
الكاتب

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

أفضل إجابة

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

....

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

...

الصورة الرمزية
إهمال
الكاتب

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.

المنشورات ذات الصلة الردود أدوات العرض النشاط
0
أكتوبر 23
3018
2
يوليو 23
6348
1
يونيو 23
4349
1
أبريل 23
5065
1
نوفمبر 22
3775