How to show currency Symbol inside the field

Can anyone please show me how to add the currncy symbol in a currency field?

I have tried add a field labeled “Currncy” and set it as a link field and put “Currency” inside the option. After that , I put “currency” inside the option for those fields I want to set this “currency”. I can see those fields will show this Currency Symbol if they are in list view.

But what i want is to to show the currency symbol within the field whose type had been set to “Currency”.

@Terry,

Set the fieldtype as Currency the frappe framework will automatically render the currency symbol before the value.

Thanks

@makarand_b, thanks for the reply.

All the fields has been set field type currncy. But the currency symbol is not showing.

@Terry,

Did you try reloading & clearing cache after changing the fieldtype ?

I am not sure if the below information is helping or not.

In the item master, i added some custom fields which are used to calculate the item cost and suggested selling price. Those field are set to filed type “currency”.
For the costing part, i want to set it in euro, and for the suggested price, i want to set it in USD.

@makarand_b, yes I did reload.
The currency field just showing the number with 2 decimals, but no symbol.

Have you submitted the document ?

@Terry In Global Defaults, check if you have selected No for Hide Currency Symbol.

1 Like

@Pawan. Thanks, I am working on the Item master, there is no “Summit” botton but i did saved. The symbol still not showing up after saved.

@KanchanChauhan, Thanks, I have checked that “Hide Currency Symbol” is set to “No” is the Global Defaults".

Another question, If i have two price lists, one is for buying and one is for selling, they are using different currency, lets say, buying is using Euro, and selling is using USD. Is there something i need to type in for the option field or write custom script?

No you should be fine. No need to add any script.

@KanchanChauhan, sorry for keep asking silly question. but how to set field is A use currency Euro and set field B use USD?

I think that you should also need to set the Symbol for the currency.
For instance I set “TL” in desk#Form/Currency/TRY
image

Hello @Terry
Was you able to find solution on below:

but how to set field is A use currency Euro and set field B use USD?

Regards
Bilal

Hi Bilal,

check out fmt_money

To find code that calls that method try this search:

frappe@ubuntu:~/frappe-bench$ find . -name '*.py' | xargs grep fmt_money

fmt_money is called here for eg

1 Like

Hello;

The currency symbol inside the field can be determined by the option field property of the field. I did not find any other way.

Except to use fmt_money which is python based or to use frappe.utils.fmt_money which is jinja based.
I tried to use frappe.utils.fmt_money in .js file but it did not work. I tried this: frappe.utils.fmt_money(doc.outstanding_amount, currency="LBP"); But it is not working in javascript.

Is there a method to be used with javascript?

I added @Denmark_Del_Puso because he used frappe.utils.fmt_money in jinja in this link:

Regards
Bilal