Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
6648 Переглядів

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.

Related Posts Відповіді Переглядів Дія
0
жовт. 23
3014
2
лип. 23
6323
1
черв. 23
4331
1
квіт. 23
5049
1
лист. 22
3762