コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
6678 ビュー

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
10月 23
3019
2
7月 23
6362
1
6月 23
4358
1
4月 23
5072
1
11月 22
3779