I have a number of currency values in a form select box (i.e. £2,500). When the form is rendered though it keeps the £ as is, is there any way to convert it to an actual pound sign?
I have a number of currency values in a form select box (i.e. £2,500
Share
If I have understand your question correctly, the problem is that
£is automatically escaped by the form library and therefore displayed as£to the user and not as £.You can probably solve the problem by telling django that the HTML code is safe and shouldn’t be escaped (might be a XSS security hole):
Alternatively you can also avoid the usage of escape sequences by typing in the characters directly (those entities aren’t part of current HTML specifications anyway, you should simply use unicode instead):
The comment with the encoding must be the first line of the current file, telling the interpreter that you are using unicode encoding in the source file.