Skip to Content
मेन्यू
This question has been flagged
2 Replies
6663 Views

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
Discard
Author

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

Best Answer

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

....

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

...

Avatar
Discard
Author

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 Replies Views Activity
0
अक्तू॰ 23
3015
2
जुल॰ 23
6339
1
जून 23
4343
1
अप्रैल 23
5061
1
नव॰ 22
3770